Jump to content

- - - - -

Creating a custom Image and Ad header per post per Category

  • Please log in to reply
1 reply to this topic

#1 john_kaufman



  • Members
  • Pip
  • 5 posts

Posted 01 April 2011 - 08:59 PM

Hi - I'm using Platform Pro Developer and with the base child theme. I'm trying to add an HTML header (containing an image and an ad) that will display at the top of each post, differentiated by category (so an Amazon Ad and Image header for all posts in my Amazon category). I'm a PHP noob and have been 'point & click' creating to this point... Everything I read points me towards creating some PHP and using the loop to determine when and what to display. I guess I'm looking for confirmation that I'm going about this properly; Do I copy/create a wp-blog-header.php (for the loop) in the base child theme and stick all my PHP Cat_ID stuff there? Any guidance is appreciated :-)

#2 kastelic



  • Members

  • 3081 posts
  • Country: Country Flag

Posted 02 April 2011 - 04:59 AM

The best way is either to put the code in template.postloop.php, or even better, put it in functions.php and use a "hook" to insert it where you want in the pages.

Please Login or Register to see this Hidden Content