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
| /** | |
| * 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
| 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
| 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
| 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
| <?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
| <?php | |
| /** | |
| * Send Gravity Forms file uploads to Amazon S3 | |
| * @author Ren Ventura <EnageWP.com> | |
| * @link http://www.engagewp.com/send-gravity-forms-file-uploads-to-amazon-s3/ | |
| */ | |
| //* Include the required library | |
| include_once 'inc/S3.php'; |
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( $ ) { | |
| 'use strict'; | |
| var attrs, attr, postType; | |
| postType = null; | |
| $(function() { | |
| // Look to see what type of post type we're working with | |
| attrs = $( 'body' ).attr( 'class' ).split( ' ' ); |
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( 'template_redirect', 'pintop_ssl_redirect', 1 ); | |
| function pintop_ssl_redirect() { | |
| //page that should be ssl | |
| if ( is_page( 1264 ) && ! is_ssl() ) { | |
| if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) { | |
| wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']), 301 ); | |
| exit(); | |
| } else { | |
| wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 301 ); |