Forums
Forums / Fixing WordPress / Show only when needed (footer)
(@koen-smid)
11 years, 1 month ago
He guys, I have a problem.
I am making a website and i need to show this code only on the homepage and another template page.
<p>My tekst <i class=”fa fa-whatsapp”></i> another text</p>
I already found a lot of “solutions” on forums and other pages but none of them work so i hoped one of you guys could help me out!
My excuses for my bad english.
(@aestheticdesign)
First off your HTML doesn’t make sense since the italics doesn’t do anything.
There are two approaches you can take.
1. Put the HTML in the footer and use PHP code to execute it based on the page. See https://codex.wordpress.org/Function_Reference/is_page for how to test what page is being displayed.
2. Put the HTML in the footer and use CSS to display or hide it based on page id found in the body tag.
What have you tried so far?
The topic ‘Show only when needed (footer)’ is closed to new replies.