How detect pagination’s pages from woocommerce shortcode ?
I am trying to use if( is_paged() ){ } but it does not work for pagination from a shortcode
. The shortcode creates parameters different from the standard parameters on the main store – product-page=1 instead of /page/2/add_filter( 'the_content', 'remove_class' , 100 );
function remove_class( $content ) {
if( is_page() && is_paged() ) {
$content = preg_replace('#<div[^>]*id="additional-desc"[^>]*>.*?</div>#is', '', $content);
return $content;
}
}
I need the text block with id=”additional-desc” to remain only on the main page –
https://example.com/name-post/
It should not be on pagination pages
https://example.com/name-post/?product-page=1
https://example.com/name-post/?product-page=2
How detect pagination’s pages from woocommerce shortcode ?