This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Remove the slug from published post permalinks. Only affect our custom post type, though. | |
| */ | |
| function gp_remove_cpt_slug( $post_link, $post, $leavename ) { | |
| if ( 'race' != $post->post_type || 'publish' != $post->post_status ) { | |
| return $post_link; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.com | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
| * Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
| */ | |
| $args = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function custom_post_type_link($permalink, $post, $leavename) { | |
| if (!gettype($post) == 'post') { | |
| return $permalink; | |
| } | |
| switch ($post->post_type) { | |
| case 'slug': | |
| $permalink = get_home_url() . '/' . $post->post_name . '/'; | |
| break; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ( have_posts() ) : | |
| while ( have_posts() ) : the_post(); | |
| endwhile; | |
| endif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //ADD RULE TO SECTION | |
| add_filter('acf/location/rule_types', 'acf_location_rules_types'); | |
| function acf_location_rules_types( $choices ) | |
| { | |
| $choices['Other']['taxonomy_depth'] = 'Taxonomy Depth'; | |
| return $choices; | |
| } | |
| //MATCHING OPERATORS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $term = get_queried_object(); //Получаю текущий обьект запроса | |
| // Узнаю текущий id рубрики | |
| $term_id = $term->term_id; | |
| ?> | |
| <?php | |
| $args = array( | |
| 'post_type' => 'product', | |
| 'product_category' => $term->slug, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'genesis_after_header', 'sk_mini_fixed_header' ); | |
| /** | |
| * Mini header with a logo image at left and menu at right. | |
| * | |
| * @author Sridhar Katakam | |
| * @link http://sridharkatakam.com/ | |
| */ | |
| function sk_mini_fixed_header() { ?> | |
| <div class="mini-header"> | |
| <div class="wrap"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // First, remove Add to Cart Button | |
| remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); | |
| // Second, add View Product Button | |
| add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_view_product_button', 10); | |
| function woocommerce_view_product_button() { | |
| global $product; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Enqueue scripts and styles | |
| add_action( 'wp_enqueue_scripts', 'themeprefix_enqueue_scripts_styles' ); | |
| function themeprefix_enqueue_scripts_styles() { | |
| wp_enqueue_style( 'themeprefix-ionicons', '//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css', array(), CHILD_THEME_VERSION ); | |
| wp_enqueue_script( 'themeprefix-offscreen', get_stylesheet_directory_uri() . '/js/offscreen.js', array( 'jquery' ), '1.0.0', true ); | |
| } |