Morning support,
I know you guys aren’t here to teach people how to code so i understand if this is away from normal support.
I have used a code block element and some html / css to create a banner that sits at the bottom of a page which can be toggled to be visible or hidden. Basically it has been set with a negative margin when closed / hidden and positive margin when open / visible with jquery handling the change.
Works fine. I want that code block to be repeated on every page without the need for saving the element as a template. That would of course work but if i needed to make a changes to the element I’d have to repeat it for every page.
Is there a way to add the code block (the html code i created) into a php file so that it appears on every page automatically? That way I’m only editing one section of code which is then echoed on every page via the php file.
Could you point me in the right direction as my php skills are about a 2 out of 10.
Many thanks
TJ
Hey TJ,
I think it would be the best if you created a shortcode – https://codex.wordpress.org/Shortcode_API and display your content using shortcode. You could add shortcode to bottom of your pages and simply change the content inside Appearance > Editor > functions.php file to apply it on all pages.
Also, you can refer to my post here – https://kriesi.at/support/topic/footer-to-mirror-top-bar/#post-604625 to add custom content above footer on all pages.
I hope one of the solutions work for you! :)
Best regards,
Yigit
Hi Yigit,
Thank for the info. I’ll look into the shortcode idea. I’m always looking to learn tricks :)
Thanks
TJ