Archived topic
Element / Display Rules: How to add only on first page when using pagination?
1 reply · Started by Filippo on April 2, 2020
Hello there,
I was wondering how can I display an Element (Hook type) in my category archive but only on the first page? Currently, my Element is shown on every page of that category (page 1, page 2, page 3, etc.).
I want to use this Element as a second description / text box (after the loop), so it should be visible only when the category description is visible as well.
Any help is appreciated, thanks!
Hi there,
You can use this filter:
https://generatepress.com/forums/topic/display-rules-for-element-to-show-only-on-home-page-not-on-page-2-3-4-etc/#post-791528
Adding PHP: https://docs.generatepress.com/article/adding-php/
Replace generate_header_element_display with generate_hook_element_display:
https://docs.generatepress.com/article/generate_hook_element_display/
Let me know if this helps :)