Hero section for category
URL to the page in question:
http://
-
I haven’t tried to display content only on the first page of an archive. There is a topic in the WP.org forums that indicates this might do that:
<?
if (is_category()) {
$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
if ($page == 1) {
echo category_description();
}
}
?>
But it’s not something that I’ve tested.
Give this a shot too:
.category #content article {
padding-bottom: 0;
}
Take care,
Bill
And where i put this code ?
The top one would go in place of
<?php the_archive_description( '<div class="category-description">', '</div>' ); ?>
in your category.php file. The bottom CSS would go in your Custom CSS box in the theme options page. No promises, but it’s worth a shot 🙂
Thank You Bill but that don’t work and it’s okay for now I can keep the description on each pages =) !!
I got a question again ^^
i would like make this presentation for an another website can you help me ? thanks
I Tried to make the same thing on another Website : http://www.evangelisons.fr but no post appear.
Bises
Jonathan
After many tries this is where i’m now :
The code you gave me work well, it’s because i make some wrong change and know i don’t have the description on second page.
I resolve the Problem about the post of http://www.evangelisons.fr.
So you can delete the post before because i can’t edit or delete them.
Now i would like this presentation for Evangelisons.fr i Hope you could help me again.
Hi Jonathan,
I took a look at http://www.evangelisons.fr/category/non-classe/ but I’m not seeing any posts there. Once you add some, I can take a look. In order to send the changes, I’ll need a page to work with. Just let me know when you’re ready.
Take care,
Bill
Hi Bill,
I desactivated Userpro because i don’t know how allow category to be show or not =) So i’m ready ^^
To line up the posts in your categories like that, add something like this to your Custom CSS:
.category.archive #content article.post {
float: left;
width: 31%;
margin-left: 1%;
margin-right: 1%;
margin-bottom: 10px;
}
Hope that helps,
Bill
That Work perfectly, and do you know where i can change the number of post per category page ?
Thank you Super Hero !!
Glad that helped out. You can change the default number of posts per page by going to Settings in your WordPress dashboard and clicking on Reading. The posts per page there will change how many are displayed for you.
Take care,
Bill
- The topic ‘Hero section for category’ is closed to new replies.