help with ?php if (in_category

Posted in: Newspaper
Post count: 14

Hi. In the theme I came from I used this code to show an image over the thumbnail of expired posts. I am trying to figure out how to add it to this newspaper theme. I added the css to theme panel> custom code> custom css

But where do I put this php? Thanks in advance.

`<?php if (in_category(‘expired’)) : ?>
<div id=”expired-icon”>
img src=”my image here”
</div>
<?php endif; ?>
<style>
#expired-icon {
position: absolute;
margin-top: -4em;
margin-left: -2em;
}

.category-expired .entry-title{
text-decoration:line-through;
}
</style>
.category-expired .entry-title{
text-decoration:line-through;
}
</style>

  • This topic was modified 9 years by ohmichea.
  • This topic was modified 9 years by ohmichea.
Post count: 23312

Hello ohmichea,

Unfortunately, I do not know what exactly you want to achieve. So, please notice that the PHP code should have to be added in the right core file from the theme. In your case, I suppose that you have to check the category template files and add there your code, like this -> https://www.screencast.com/t/ZdAh6LLCW8 This is just a simple suggestion. So, if you want to display more levels in our theme and if you are not aware of the steps which are needed to take in this regard, please consider hiring a freelancer/developer to help you because we cannot provide custom work at the moment, sorry!

Thanks for your understanding!

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