Archived topic
Blog Page Header in Categories
4 replies · Started by dinkummate on January 7, 2016
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
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 :)
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
Hi Tom, here is the result.
http://www.stegosblog.com/category/stegos-travels/
Thank you again!
Andreas
You're welcome! It looks great :)
