How to Loop ‘Previous Post’ and ‘Next Post’ block’s functionality
-
Hi,
How can we loop the previous and next post block’s functionality so instead of getting to the lat post and ending, it loops back to the first post?
Or if this is not possible, can we at least display either control when it disappears at the first or last post as an inactive UI element? I’ve tried with CSS but nothing’s working (so far), but maybe I’ve not done this completely right. I’ll paste the code I’ve tried for this fall back solution but any information or ideas appreciated, thank you!
/* Show the previous post navigation link at all times */ .wp-block-post-navigation__prev-link { display: block !important; } /* Adjust the styling of the inactive previous post navigation link */ .wp-block-post-navigation__prev-link.inactive { opacity: 0.5; /* Additional styling properties here */ } /* Show the previous post navigation link at all times */ .post-navigation-link-previous { display: block !important; } /* Adjust the styling of the inactive previous post navigation link */ .post-navigation-link-previous.inactive { opacity: 0.5; /* Additional styling properties here */ }
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘How to Loop ‘Previous Post’ and ‘Next Post’ block’s functionality’ is closed to new replies.