Help with PHP Hook
-
This is all that is in my Child Theme PHP file:
<?php function insertHeadImage($content) { if(!is_feed() && !is_home()) { $content.= "<div class='Head'>"; $content.= "<img src='https:// martcol.co.uk/abba/wp-content/uploads/sites/7/2014/02/cropped-abba-skip-hire-logo.png' /a>"; $content.= "</div><!-- div.head-->"; } return $content; } add_filter ('the_content', 'insertHeadImage'); ?>
I added this to the header.php file where I think I want the content to be but it makes no difference:
<?php insertHeadImage($content); ?>
The added HTML currently appears a the bottom of my content so I have two questions:
1)How does WordPress know to put it where it puts it
2) What do I do to generate some content and add it where I want i to go.Thanks
Martin
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Help with PHP Hook’ is closed to new replies.