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