Community Forums › Forums › Archived Forums › Design Tips and Tricks › Remove Infinite Scroll from Specific Archive Page
Tagged: infinite scroll
- This topic has 8 replies, 2 voices, and was last updated 12 years ago by
daveszt.
-
AuthorPosts
-
July 2, 2014 at 2:37 pm #112721
daveszt
MemberToday I've turned on Infinte scroll and have it working nicely but i'd like to remove it from one specific archive page but operate on all others.
The code i currently have is below but i want to remove it working on this page:
http://www.heyuguys.com/competitions/ which is category ID 226.
Thanks.
D
function ntg_infinite_scroll_init() {
http://www.heyuguys.com/
add_theme_support( 'infinite-scroll', array(
'container' => 'content',
'footer' => 'footer',
'render' => 'genesis_do_loop'
) );
}
add_action( 'after_setup_theme', 'ntg_infinite_scroll_init' );July 2, 2014 at 10:20 pm #112772Tonya
MemberHi Dave,
Give this a try:
function ntg_infinite_scroll_init() { //* Bail out if it's 'competitions category if (is_category('competitions') return; // Leave the rest of this function the same as it isYou can place the category slug or it's ID number in the is_category() function.
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampJuly 3, 2014 at 3:06 am #112805daveszt
MemberThanks Tonya. I've added that in but get the error:
Parse error: syntax error, unexpected end of file in /homepages/23/d310607419/htdocs/HeyUGuys_com/wp-content/themes/lifestyle/functions.php on line 221
Ive tried putting that in a few different places but it doesnt seem to like it.
D
July 3, 2014 at 4:01 am #112819Tonya
MemberHi Dave,
Sorry I missed a the closing ) on the if statement. It should be:
if (is_category('competitions')) return;
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampJuly 3, 2014 at 4:13 am #112821daveszt
MemberAha, no crashing but it doesnt seem to work. Still loads the first 7 then the rest load when you scroll down.
Do i need to put this line within the other set of code or at the bottom? I've tried both.
July 3, 2014 at 12:54 pm #112898Tonya
MemberHi Dave,
I've got family here right now. I'll run some tests tonight and get back with you.
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampJuly 3, 2014 at 3:15 pm #112901daveszt
MemberHugely appreciated. Thx.
July 4, 2014 at 3:29 am #112940Tonya
MemberHey Dave,
I see that the infinite scroll is now disabled on this category page. Were you able to resolve it?
Software & Electrical Engineer and Programming Teacher · I’m on a mission to help developers be more awesome.
Find Me: KnowTheCode.io | @hellofromTonya | Profitable WordPress Developer BootcampJuly 8, 2014 at 6:16 am #113364daveszt
MemberSorry Tonya, i missed your reply. Not resolved as yet. It's still active.
D
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.