jllamosas
Member
Posted 5 months ago #
Hi all!
Im using the plugin Infinite Scroll: http://wordpress.org/extend/plugins/infinite-scroll
And I need to use the feature in a single page of a cutom post type: single-celebrities.php
I found this code, but I cant find the way to activate the infinite scroll in this kind of page.
function my_load_infinite_scroll( $load_infinite_scroll ) {
if( is_page('news') )
return true;
return $load_infinite_scroll;
}
add_filter('infinite_scroll_load_override', 'my_load_infinite_scroll');
Any idea?
check this page:
http://codex.wordpress.org/Conditional_Tags#A_Single_Page.2C_Single_Post_or_Attachment
Should be something like:
replace
if( is_page('news') )
by
is_singular( 'celebrities' )
jllamosas
Member
Posted 5 months ago #
It is not running yet :(
function my_load_infinite_scroll( $load_infinite_scroll ) {
is_singular( 'celebrities' );
return true;
return $load_infinite_scroll;
}
add_filter('infinite_scroll_load_override', 'my_load_infinite_scroll');
Sorry
function my_load_infinite_scroll( $load_infinite_scroll ) {
if( is_singular( 'celebrities' )) {
return true;
return $load_infinite_scroll;
}
if( is_page('news') ) {
return true;
return $load_infinite_scroll;
}
}
add_filter('infinite_scroll_load_override','my_load_infinite_scroll');
This should work.
jllamosas
Member
Posted 5 months ago #
It is not running yet. And the code blocks the normal functionallity of the infinit-scroll in the category pages.
If this doesn't work, you should try and post on the plugin support forum:
http://wordpress.org/support/plugin/infinite-scroll
function my_load_infinite_scroll( $load_infinite_scroll ) {
if( is_singular( 'celebrities' )) {
return true;
}
if( is_page('news') ) {
return true;
}
return $load_infinite_scroll;
}
add_filter('infinite_scroll_load_override','my_load_infinite_scroll');