Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter jmichaeledwards

    (@jmichaeledwards)

    To make this plugin work with the parallax-pro from Genesis, and to work with Mashable, we added the following to my theme’s functions.php file. And I also have a custom post type called “issue”. If I remember, we’ve got something in there to make it work with that too. Hope this helps, and I apologize for the slow response.

    // Add a CSS ID to main element for Infinite Scrolling
    add_filter( ‘genesis_attr_content’, ‘lc_custom_attributes_content’ );
    function lc_custom_attributes_content( $attributes ) {
    $attributes[‘id’] = ‘main-content’;
    return $attributes;

    }

    // Infinite Scrolling
    add_action( ‘init’, ‘metro_pro_infinite_transporter_init’ );
    function metro_pro_infinite_transporter_init() {
    add_theme_support( ‘infinite-transporter’, array(
    ‘container’ => ‘main-content’,
    ‘footer’ => false,
    ‘render’ => ‘genesis_render’,
    ‘google_analytics’ => true
    ) );
    }
    function genesis_render() {
    if ( have_posts() ) :

    do_action( ‘genesis_before_while’ );
    while ( have_posts() ) : the_post();

    do_action( ‘genesis_before_entry’ );

    printf( ‘<article data-url=”%s” %s>’, get_permalink(), genesis_attr( ‘entry’ ) );

    do_action( ‘genesis_entry_header’ );

    do_action( ‘genesis_before_entry_content’ );

    printf( ‘<div %s>’, genesis_attr( ‘entry-content’ ) );
    do_action( ‘genesis_entry_content’ );
    echo ‘</div>’;

    do_action( ‘genesis_after_entry_content’ );

    do_action( ‘genesis_entry_footer’ );

    echo ‘</article>’;

    endwhile; //* end of one post

    else : //* if no posts exist
    do_action( ‘genesis_loop_else’ );
    endif; //* end loop
    }
    // Start Vitaly-jme77
    // Fix on infinite scroll plugin to match post_type
    add_action(‘single_infinite_transporter_query_args’, ‘infinite_scroll_post_type_fix’);
    function infinite_scroll_post_type_fix($query_args)
    {
    $query_args[‘post_type’] = get_post_type((int)$_REQUEST[‘postID’]);
    $query_args[‘date_query’] = array(
    array(
    ‘before’ => $_REQUEST[‘last_post_date’],
    ‘inclusive’ => true,
    )
    );

    return $query_args;
    }
    add_filter(‘the_content’,’mashsharer_ajaxload_exclude’, 9999, 1);
    function mashsharer_ajaxload_exclude($content){
    if(defined(“DOING_AJAX”) && DOING_AJAX){
    $content = preg_replace(‘#<aside class=”mashsb-container”>(.*?)</aside>#is’, ”, $content);
    }
    return $content;
    }
    //End Vitaly-jme77

    Thread Starter jmichaeledwards

    (@jmichaeledwards)

    I figured out what’s going on. It took a day of playing with it to realize it, but I think with lack of sleep I was just being slow. My theme adds large image sizes and I just need to uncheck support for them as I don’t even use them. As I get to know it better I am enjoying this plugin and will leave a review soon.

    Thread Starter jmichaeledwards

    (@jmichaeledwards)

    I found it in another thread. I had read the thread but missunderstood something.

    I know use this code:

    add_filter(‘pre_get_posts’, ‘query_post_type’);
    function query_post_type($query) {
    if(is_category() || is_tag()) {
    $post_type = get_query_var(‘post_type’);
    if($post_type)
    $post_type = $post_type;
    else
    $post_type = array(‘nav_menu_item’,’post’,’issue’);
    $query->set(‘post_type’,$post_type);
    return $query;
    }
    }

    adding the nav_menu_item makes everything work right.

    Thank you boyvanamstel!

    Thread Starter jmichaeledwards

    (@jmichaeledwards)

    I did, and it was showing the YARRP twice that way. I fixed it by accident and for the life of me cannot figure out how I did it. If anyone else is having this trouble try Googling Yarrp manual shows up twice.

    But I have a new question related to this if you don’t mind. I’d really like a way to call related posts in a different format. I have posts set up as thumbnails. Can I call related posts as a list without setting the YARRP to “list”?

    BTW, love the plugin and thank you for keeping up with the support as well as you do!

Viewing 4 replies - 1 through 4 (of 4 total)