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 | |
| /** | |
| * Variable product add to cart | |
| * | |
| * @author WooThemes | |
| * @package WooCommerce/Templates | |
| * @version 2.4.0 | |
| * In theme/child theme directory add woocommerce/single-product/add-to-cart/ | |
| */ | |
| if ( ! defined( 'ABSPATH' ) ) { |
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
| remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
| add_action( 'genesis_loop', 'tht_featured_home', 5 ); | |
| function tht_featured_home() { | |
| $where = "book_featured.meta_value='1'"; | |
| $params = array( | |
| 'where'=> $where, | |
| 'order' => 'ASC', | |
| 'limit' => 1, |
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
| remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
| add_action( 'genesis_loop', 'tht_book_archive_custom_loop' ); | |
| /** | |
| * Genesis custom loop | |
| */ | |
| function tht_book_archive_custom_loop() { | |
| $books = new Pod('book'); | |
| $params = array( | |
| 'order' => 'ASC', | |
| 'orderby' => 'title', |
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 tht_add_pods_groups () { | |
| pods_group_add( 'book', 'About The Book', 'book_featured, book_short_title, book_subtitle, book_cover_image, book_cover_caption, book_description, book_background_image, book_author, book_available_at' ); | |
| pods_group_add( 'place', 'Available From', 'place_name, place_link, place_icon, related_book' ); | |
| } | |
| add_action( 'pods_meta_groups', 'tht_add_pods_groups' ); |
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
| /** | |
| * Force Template | |
| */ | |
| add_filter( 'template_include', 'tht_force_template' ); | |
| function tht_force_template($template){ | |
| if ( 'cpt_name' == get_post_type()){ | |
| $template = get_query_template( 'template-name' ); | |
| } | |
| return $template; |
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( 'pre_get_posts', 'tht_change_cpt_posts_per_page' ); | |
| /** | |
| * Change Posts Per Page for CPT Archive | |
| */ | |
| function tht_change_cpt_posts_per_page( $query ) { | |
| if( $query->is_main_query() && !is_admin() && (is_post_type_archive( 'definitions' )|| is_post_type_archive( 'question' )) ) { | |
| $query->set( 'posts_per_page', '18' ); | |
| } | |
| } |
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('pods_api_post_save_pod_item_book', 'tht_set_home', 10, 3); | |
| function tht_set_home( $pieces, $is_new_item, $id ) { | |
| //get the value of the 'genre' field | |
| $featured =$pieces[ 'fields' ][ 'book_featured' ][ 'value' ]; | |
| $blog = get_page_by_path( 'blog' ); | |
| if( $featured ){ | |
| update_option( 'show_on_front', 'page' ); |
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 | |
| /* | |
| Template Name: Single {CPT} | |
| */ | |
| remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 ); | |
| remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); | |
| remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 ); | |
| genesis(); |
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
| //Change the Product description heading | |
| add_filter('woocommerce_product_description_heading', 'ps_custom_product_description_heading'); | |
| function ps_custom_product_description_heading(){ | |
| return __( 'Custom Product Description' ); | |
| } |
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
| .awac-wrapper{ | |
| width: 50%; | |
| display: inline-block; | |
| } |