Black Friday Sale! Get up to $40 off GP Premium!Learn more

[Resolved] Blog Page Header in Categories

Home Forums Support Blog Page Header in Categories

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #164123
    dinkummate

    Hi Tom or anyone who knows how,

    is it possible to create an individual blog page header for each category? My website is more like a magazine. I am using categories in my menu to choose articles after topics, see http://www.stegosblog.com. It would look great if I could see there also a page header like in pages, posts and in the blog itself.I love the masonry of GeneratePress very much. I could use a page instead a category, but I would miss the cool blog add-on feature.

    Thank you,

    Andreas

    #164152
    Tom
    Lead Developer
    Lead Developer

    Hi Andreas,

    Unfortunately there’s no page created for categories, so there’s no where for us to add the options.

    However, you could use GP Hooks to accomplish this.

    More info here: https://generatepress.com/forums/topic/gp-hooks-2/

    For example, in the “After Header” hook, you could do something like this:

    <?php if ( is_category( 'Category Name' ) ) : ?>
          <div class="page-header-image grid-container grid-parent generate-page-header">
                <img src="URL TO YOUR CATEGORY HEADER IMAGE" alt="" itemprop="image">
          </div>
    <?php endif; ?>

    Then check the “Execute PHP” checkbox and change the “Category Name” and src to your specific values.

    Hope this helps 🙂

    #164159
    dinkummate

    Hi Tom,

    that is great. I gave it a try. I only adjust the size of my images as parallax and full width is not available, add the text (headline) I want in PS and I have the effect I wish. Excellent!

    You always have a solution. You are such a Genius!

    Salamat po, Thank you, Danke!

    Andreas

    • This reply was modified 4 years, 10 months ago by dinkummate.
    #164179
    dinkummate

    Hi Tom, here is the result.

    http://www.stegosblog.com/category/stegos-travels/

    Thank you again!

    Andreas

    #164197
    Tom
    Lead Developer
    Lead Developer

    You’re welcome! It looks great 🙂

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