- This topic has 6 replies, 2 voices, and was last updated 4 years, 2 months ago by Leo.
May 29, 2017 at 6:35 am #325602Satori
Hello! right now I’m using elementor to make templates and assign them via shortcode in the GP hooks widget. Inside my article everything looks fantastic. But on my pages it is simply not nice, I wonder if there’s a way to display the shortcodes only on certain areas. I know nothing about coding, but maybe a “PostOnly” solution may exist.GeneratePress 1.3.46GP Premium 1.3May 29, 2017 at 6:36 am #325603Satori
Sorry I didn’t include the link, this is the website: https://luzocultaoficial.com/
And the template I want to remove from pages is the social share bar. I just want it to be seen in the post page.May 29, 2017 at 8:44 am #325674LeoStaffCustomer Support
I’m not 100% sure what you mean but sounds like you need to wrap the shortcode with conditional tags inside hooks so that it only shows on posts/pages: https://codex.wordpress.org/Conditional_Tags
Let me know if this helps or if you need more info 🙂May 29, 2017 at 4:25 pm #325878Satori
Hi Leo! Thanks in advance for your support. Yes, this seems to be the answer for my request. Sadly I don’t know anything about coding, my brother is learning so he did try to apply the conditional tag without success. If it isn’t too much to ask, could you please tell me what is the exact piece of code you’d put to display a shortcode only on a single post page. And will this be applied in the Hook area?
Here are some screenshots for you to see my exact problem. The Social Share bat and the Related Posts area are being displayed via shortcode, they were created in Elementor. Of course I don’t want them to be on my main page nor blog or category page, I just need them on the single post page.
Hope you can help me.
Screenshot gallery: http://bit.ly/2sfnTq0May 29, 2017 at 6:33 pm #325901LeoStaffCustomer SupportMay 30, 2017 at 5:39 am #326087Satori
It works like a charm! Thank you Leo for your support, whenever you come to Mexico let me know, I’ll share with you some delicious tacos! Best vibes.May 30, 2017 at 8:31 am #326150
- You must be logged in to reply to this topic.