Inputting a new function
-
Hi Ben,
I’m just trying to create a function that places a brief passage of text at the end of every post except certain ones I choose and be able to update these when necessary.
I am pretty much a total noob when it comes to coding so I’m probably way off. But this is what my research led me to do doing. Only problem is it breaks my site (test site) every time I do it no matter what I try.
So I go to function.php and paste in the following code:
<?php
if ( is_single() && !is_single( array( ’example-page-one’, ’example-page-two’ ) ) ) {
echo “There’s only one product I truly recommendHere’s how it works…”;
}
?>The idea is to have that display as if I’d written it at the end of every post, bar a select few I choose for it not to display on. The ‘heres how it works’ is supposed to be the anchor text to my main offer page.
Is the code correct?
Where does it go exactly in the Ignite theme?Many thanks for your help Ben, cheers!
Tim
- The topic ‘Inputting a new function’ is closed to new replies.