Hi Tom.
In this topic, https://generatepress.com/forums/topic/hook-question , you posted some PHP for excluding a number of pages for the display of a shortcode. Works fine π
However, I am using the following to do something similar, except this is to display one shortcode on a couple pages and another on one page. The code below works fine in the GP Hooks but I am a bit puzzled (doesn’t take much π ) about the syntax when compared to yours. Yours has more PHP tags enclosing the echo statements, etc. I found the syntax I used on Stack Overflow, so I am just wondering if it is ‘legit’ π
<?php
if ( is_page( array( 'services', 'about' ) ) ) {
echo do_shortcode( '[INSERT_ELEMENTOR id=115]' );
} else {
echo do_shortcode( '[INSERT_ELEMENTOR id=21]' );
}
?>
Cheers!
Lyle