Image at top of category page

Posted in: Newsmag
Post count: 8

Hi

Loving the theme, trying to set it up for my online magazine but have one issue. I’d like to change the category page design a bit, specifically to add a header/a place for an image.

Here’s a picture of what I’d like to be able to do:

View post on imgur.com

Any help/advice would be greatly appreciated!!

Post count: 6535

Hi

You need to edit category.php file and add a new container for the image like here: http://screencast.com/t/GFvCVVApC5

<div class="category-image">
<img src="image url/path"/>
</div>

Then you can use the css class: category-image to customize the image as you want, here is an example: http://screencast.com/t/mmCYujXajn

.category-image img{
margin-left: auto;
margin-right: auto;
}

More useful information about css coding can be found here: http://www.w3schools.com/css/default.asp

Hope this help.
Thanks!

  • This reply was modified 10 years by Andrei L..
Post count: 8

Thank you for the quick response! That does seem to do exactly what I need. The only issue I see is that this will presumably load the same image for every category. If I wanted to have a different image for each category, how would I go about that?

Thanks in advance!

Post count: 6535

Hi

You will need a set of condition like here: http://screencast.com/t/bqjQ4mvZYVhttp://pastebin.com/BchV1cPH Basically using is_category() function you will be able to load a different image depending by category id. To get the category id follow this link: http://screencast.com/t/iR5PveqzVlb

Let me know how it goes.
Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newsmag’ is closed to new topics and replies.