Is there an easy way to implement a banner (not using JavaScript) that appears at the top of blog posts, but only within a specific category? I’d like to avoid showing it above all posts sitewide. Or is it possible only with a snippet?
Additionally, is there a way to display a sidebar banner only for posts in a certain category?
I’d really appreciate any guidance on how to set this up.
hi, thank yoi for your reply.The banner is not Google banner, it is from my customer and I want to place it only on certain categories on the top of a blog post as well as a sidebar. Ho to do it?
Hi there,
Is there an easy way to implement a banner (not using JavaScript) that appears at the top of blog posts, but only within a specific category? I’d like to avoid showing it above all posts sitewide. Or is it possible only with a snippet?
Additionally, is there a way to display a sidebar banner only for posts in a certain category?
I’d really appreciate any guidance on how to set this up.
Thank you in advance
Hi,
You should paste this code into the function.php of the child theme or via the CodeSnippet plugin here: https://wordpress.org/plugins/code-snippets/
Regards,
PenciDesign.
hi, thank yoi for your reply.The banner is not Google banner, it is from my customer and I want to place it only on certain categories on the top of a blog post as well as a sidebar. Ho to do it?
Hi,
At this time, there is no available hook to insert content into a specific sidebar widget. You should manually add it via Appearance → Widgets.
The previous code I sent will apply the ads code at the top of posts for specific category IDs.
Regards,
PenciDesign.