Celebrating 7 Years! Get up to $30 off GeneratePress Premium!

[Resolved] Page Header for Blog page and posts

Home Forums Support [Resolved] Page Header for Blog page and posts

Home Forums Support Page Header for Blog page and posts

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #13563
    Ben Crawford

    Love the theme and addons… But ive hit a road block that is keeping me from going live. I have my site setup so my branding is incorporated into a metaslide that changes page by page using the custom header plugin. This has worked great up until I went to work on the blog page. the custom header seems to be stripped on both the WP Posts page and on each individual post. Is there a way to work around this? I updated all my plugins yesterday after reading another users similar issue, however that just seems to fix the featured image and not exactly what im trying to do. In short I guess Im asking if there is a way to have the header image show on the posts and posts page without using hooks?

    Lead Developer
    Lead Developer

    Glad you’re enjoying the theme πŸ™‚

    What do you mean by stripped? Is there a page you can show me so I can see exactly what’s happening?

    Ben Crawford

    I dont have it live at the moment so i can try to explain better. IF not we can work something out. Basically the page i use for the blog posts is called “News” when this is just a page the custom header works fine. As soon as i go into setting->reading-> and set the news page as the blog page the header image disappears. and also the header image is ignored on posts. The update as setting the header image as the featured image is another issue I will need to work through but the page of “news” i still feel should honor the custom header and im not sure why its not.

    Currently Im trying to add a conditional hook to the header for these pages using the hooks plugin. The code isnt working but i think that is more me not formatting the if correctly. Also The image is transparent, and the header field extends the header color. Its close enough and only on a few pages so i can live with that. but I do need that header image to show at least somehow. I would think you could test this just by putting a custom page header on a page and setting it then to be the blog page in WP settings.

    Thanks for the help.

    Ben Crawford

    did some addon reading in the other section of your forum and I found a fix which actually works great. Basically I hooked in “after header” with an If statement to show on just these pages. I will redo most my pages so this stays automated for future pages. Just needed to think about this a different way. Still not sure why the custom header doesnt work on the post page. I think i read in a post that this is by design. But if its not and you need more info let me know.

    <?php if ( is_home()||is_single() ) : ?>
    [metaslider id=16]
    <?php endif; ?>;
    Lead Developer
    Lead Developer

    Sorry for not getting back to you sooner.

    The blog index is something I’m still working on when it comes to a page header, simply because the actual “Blog” page you add doesn’t send any of it’s options to the live page. This is just the way WordPress works when it comes to the blog index (is_home()).

    Your solution above is actually what I would suggest.

    However, the is_single() isn’t necessary, as individual posts have a Page Header option that should work no problem. Are the page headers on your single posts not showing up at all? If so, this isn’t intended behavior.

    Let me know πŸ™‚

    Ben Crawford

    Not a problem. It was your reply from another thread that got me there. So you did your part πŸ™‚

    is_single is actually there just to make life easier on me. As other, lets be kind and say less technically inclined, people will be creating and updating the posts and not myself. This keeps them from having to add the page header to each post. It just happens automatically and they can’t forget to include it.

    Thanks for the info, good to know i was on the right track. Ill mark this as resolved.

    Lead Developer
    Lead Developer

    Ah, so you’re using the same metaslider for every post. Got it πŸ™‚

    Your code is perfect then.


Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.