• Resolved 5high

    (@5high)


    Hi again,

    I’d like to show the main header image for all site pages and a different header image with all blog posts – I can find info about adding it just for one post for not for all blog posts.

    I’ve searched the forums (and the codex – which I really struggled with for this) which only gave me a plugin option, but I’d rather put it in my child theme to keep it ‘light’, rather than end up with too many plugins on the site.

    As always, any suggestions much appreciated!

    Cheers.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You can user is_single() for post’s and is_page() for pages.

    Example:

    if( is_single('hello-world') ){
    echo 'hello world';
    }

    Read Here:
    Codex

    Thread Starter 5high

    (@5high)

    Hi gabriel,

    Thanks for your reply. Unfortunately I find the codex for this really hard to grasp – I understand that I’d put the code in the child functions.php file (or should it be in the header.php??) but don’t know how to configure it to call up a specific image.

    Probably pretty basic stuff, but I’m a real newbie with php, so if you can be more specific that’d be great.

    Cheers.

    Thread Starter 5high

    (@5high)

    OK, I’ve resorted to a plugin as an easy fix for this – and it’s brilliant, so thought I’d share… called ‘WP Display Header’ found here: https://www.ads-software.com/plugins/wp-display-header/.

    Thanks for the help, though, gabrielcastillo.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to write a conditional tag in twentytwelve child header.php for all posts?’ is closed to new replies.