Archived topic
Element not hiding on pagination links
3 replies · Started by priyankeshu on August 23, 2022
hello
i have one element on home page, which is still showing on pagination link pages
home page: http://www.thinkovert.com
pagination example: https://www.thinkovert.com/page/2/
any ideas how to hide on pagination pages?
i have of course, set up settings to only show this on homepage.
Hi Priyankeshu,
You can try with generate_element_display filter.
Reference: https://docs.generatepress.com/article/generate_element_display/
For instance,
add_filter( 'generate_block_element_display', function( $display, $element_id ) {
if ( 100 === $element_id && is_paged() ) {
$display = false;
}
return $display;
}, 10, 2 );
Replace 100 with your Block Element’s ID.
Adding PHP reference: https://docs.generatepress.com/article/adding-php/#code-snippets
hello,
can you please explain where do i add the above mentioned code?
Here - Adding PHP reference: https://docs.generatepress.com/article/adding-php/#code-snippets