Black Friday Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

Reply To: Prevent Page Scroll When Clicking the More Link

Home Forums Support Prevent Page Scroll When Clicking the More Link Reply To: Prevent Page Scroll When Clicking the More Link

#186535
Tony

This fails.
I’m a bit confused – looking at the if statement it returns the same as it did before if the tag is found? Should the code be:

if ( has_tag( ‘No Jump’) ) :
return apply_filters( ‘generate_more_jump’,’#more-‘ . get_the_ID() );
endif;
return ‘ ‘;

BTW is the full stop after #more- correct? I tried a comma but it makes no difference. Also tried removing space after full stop.

The code recognises the tag but this line of code causes a problem:
return apply_filters( ‘generate_more_jump’,’#more-‘ . get_the_ID() );

I have it so the first post on the Home page does have the tag and the second post does NOT have the tag.

As soon as a post is found NOT to have the tag no further posts are shown on the Home page and the post without the tag only shows the post title.

There is no scroll when clicking ‘more’ on the first post even though it has the tag which seems correct given the way the if statement is setup.

I am sure we can get it working – this is not an urgent issue though.

Is there not a way to detect some text in the post e.g. <!–scroll–> instead of a tag? I don’t use post tags anywhere at this time but may do in the future

  • This reply was modified 4 years, 7 months ago by Tony.