Hi Kor,
Thanks for replying, but I think you’ve misunderstood my request.
I’m not trying to insert a GD shortcode.
Basically what I want to do is display a different plugin’s shortcode (which will display a table or graphic) on a CPT listings page IF, AND ONLY IF, it’s a particular CPT.
So, I’m wondering if there’s a solution similar to this:
https://wpgeodirectory.com/docs/common-code-snippets/#package
In this example, I inserted this code:
// add the package id to the body
add_filter( 'body_class', 'my_add_package_class',10,1 );
function my_add_package_class($class){
global $post;
if (geodir_is_page('detail') && isset($post->package_id)) {
$class[] = "gd-package-id-".$post->package_id;
}
return $class;
}
into my child theme’s functions.php to allow me to show/hide text widgets based on the value of gd-package-id.
Is there a similar piece of code that will allow me to show/hide content elements on a listings page (and a listings detail page) based on the CPT type?
Thanks,
Paul