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 // <- Ignore this | |
| // Copy the code below and paste it to your child theme's functions.php file | |
| add_filter( 'fl_builder_loop_query_args', function( $args ) { | |
| $settings = $args['settings']; | |
| $post_type = $args['post_type']; | |
| $post__in = $post__not_in = 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
| @media only screen and (min-width: 768px) { | |
| .team-members-grid .pp-content-post-grid.pp-equal-height { | |
| display: grid; | |
| grid-template-columns: repeat(5, 1fr); | |
| grid-auto-rows: min-content; | |
| grid-column-gap: 3%; | |
| grid-row-gap: 3ch; | |
| height: auto !important; | |
| } | |
| .team-members-grid .pp-content-post-grid.pp-equal-height:before, |
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 // ignore this | |
| // Copy the code below to your current theme's functions.php file. | |
| // Uses: [get_term_image_url] or [get_term_image_url term_id="PROVIDE TERM ID HERE"] | |
| add_shortcode( 'get_term_image_url', function( $atts ) { | |
| $term_id = 0; | |
| if ( isset( $atts['term_id'] ) && ! empty( $atts['term_id'] ) ) { | |
| $term_id = $atts['term_id']; | |
| } else { |
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
| // PowerPack Content Grid - Show only rendered products terms in filters | |
| add_action( 'pp_cg_before_posts', function( $settings, $query ) { | |
| if ( 'no' == $settings->post_grid_filters_display || 'none' == $settings->post_grid_filters ) { | |
| return; | |
| } | |
| add_filter( 'pp_cg_filtered_terms', function( $filtered_terms, $terms, $module_settings ) use ( $query ) { | |
| $rendered_terms = array(); | |
| $posts = $query->get_posts(); |
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
| $(window).on('scroll.pp-animate', function() { | |
| var scrollTop = $(window).scrollTop(), | |
| winHeight = $(window).height(), | |
| triggerpoint = winHeight * .8 + scrollTop; | |
| // If module has animation, otherwise remove .fl-animated class here. | |
| $('.animate-post-count.fl-animated .pp-category-count').each(function() { | |
| if ( $(this).hasClass( 'revealed' ) ) { | |
| return; | |
| } | |
| var counterElement = $(this).offset().top; |
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($) { | |
| $(document).on('pp_modal_box_rendered', function(e, $scope) { | |
| if ( $scope.find( '.woopack-products-grid-wrap' ).length > 0 ) { | |
| $scope.find( '.woopack-products-grid-wrap' ).each(function() { | |
| var nodeId = $(this).closest('.fl-module').attr('data-node'); | |
| if ( 'undefined' !== typeof window['woopack_' + nodeId] ) { | |
| var obj = window['woopack_' + nodeId]; | |
| if ( ! obj.masonry ) { | |
| obj._gridLayoutMatchHeight(); | |
| } |
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
| /** | |
| * How to use: [my_custom_timer id="my-timer" time="300" placeholder="00:00"] | |
| */ | |
| add_shortcode( 'my_custom_timer', function( $attrs ) { | |
| // id attribute for the timer HTML. | |
| $id = isset( $attrs['id'] ) && ! empty( $attrs['id'] ) ? $attrs['id'] : 'my-timer'; | |
| // set the time to start countdown (in seconds). | |
| $time = isset( $attrs['time'] ) && ! empty( $attrs['time'] ) ? intval( $attrs['time'] ) : 120; | |
| // default placeholder to appear on load | |
| $placeholder = isset( $attrs['placeholder'] ) ? $attrs['placeholder'] : ''; |
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_filter( 'pp_post_image_settings_data', function( $data, $settings ) { | |
| global $post; | |
| if ( false !== strpos( $data['photo_src'], 'placeholder.jpg' ) ) { | |
| $terms = get_the_terms( $post->ID, 'category' ); // Here "category" is the post taxonomy slug. | |
| if ( ! is_wp_error( $terms ) && ! empty( $terms ) ) { | |
| $term = $terms[0]; | |
| $term_thumb_id = get_term_meta( $term->term_id, 'taxonomy_thumbnail_id', true ); |
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
| // Using product_brand taxonomy in this example. | |
| add_shortcode( 'product_brand_desc', function() { | |
| if ( ! is_single() ) { | |
| return; | |
| } | |
| $current_post_terms = wp_get_post_terms( get_the_ID(), 'product_brand', array( 'fields' => 'ids' ) ); | |
| $desc = ''; | |
| if ( ! is_wp_error( $current_post_terms ) && ! empty( $current_post_terms ) ) { | |
| $current_post_term = $current_post_terms[0]; | |
| $desc = get_term_field( 'description', $current_post_term ); |
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_shortcode( 'cg_post_featured_image', function( $attrs ) { | |
| $args = wp_parse_args( $attrs, array( | |
| 'linked' => 'yes', | |
| ) ); | |
| $image = get_the_post_thumbnail( $post, $settings->size, array( | |
| 'itemprop' => 'image', | |
| 'class' => 'post-featured-image', | |
| ) ); |