Add custom HTML to posts page

I want to add a header image via some custom HTML to the posts page but can’t edit it with the pages menu in WordPress.
Is there a way to add the HTML in the specific PHP-File and which PHP do I have to pick?

2 Answers
2

If you want to modify the main <header> output take a look at header.php. This file will be called before the other templates.

If you want to modify the template that is used to display your latest blog posts, index.php would be the file of choice.

Index.php is also the fallback template for any post object so you might want to let it as it is to avoid the special content being displayed on any other site.

You could conditionally hook into pre_get_posts and do your modifications there.
You could create your own action hooks and fire them conditionally. There are many ways to achive modifications.

For Conditionals see

  • http://codex.wordpress.org/Conditional_Tags

Leave a Comment