Community Forums › Forums › Archived Forums › Design Tips and Tricks › Customizing Category Archive Content Post entries
- This topic has 7 replies, 2 voices, and was last updated 12 years, 11 months ago by
[email protected].
-
AuthorPosts
-
February 12, 2013 at 4:56 pm #19943
[email protected]
ParticipantAt http://test4.e9designs.com/sample-post-with-headlines/
I have a 174px padding set above each #content .post#content .post {
padding: 174px 20px 15px 20px;
overflow: hidden;
margin: 0px 0 0;
border-bottom:1px solid #DFDFDF;
}However, on the category archives pages, I do NOT want the top padding to be there above each post excerpt:
http://test4.e9designs.com/category/business/Is there any easy way to customize the category archive page like this?
Thank you!
~AnneFebruary 13, 2013 at 1:51 am #20032Brad Dalton
ParticipantAdd a custom class for cat archives and change the padding.
February 13, 2013 at 4:34 pm #20164[email protected]
ParticipantBrad, thank you so much! I'm doing something wrong, because now I've received an error message:
Fatal error: Cannot redeclare add_body_class() (previously declared in /home/e9design/public_html/test4/wp-content/themes/custom-theme/functions.php:15) in /home/e9design/public_html/test4/wp-content/themes/custom-theme/functions.php on line 27
This is what I pasted into the functions.php file:
/** Add custom body class to the head */
add_filter( 'body_class', 'add_body_class' );
function add_body_class( $classes ) {
if ( is_category( 'business' ))
$classes[] = 'custom-class';
return $classes;
}I *so* much appreciate your help!
~Anne
February 14, 2013 at 1:33 am #20254Brad Dalton
ParticipantIts already added it in your child themes functions.php file.
You can grab the body class from your source code:
<body class="archive category category-business category-3 custom-background custom-header header-full-width full-width-content custom-class">
I tested this and it works:
.category-business { background: yellow; }
February 14, 2013 at 11:13 am #20335[email protected]
ParticipantAhhhh.... thank you *very* much!
This code worked:
.category-business #content .post {
padding: 0px 20px 15px 20px;
}I will learn eventually, right? 🙂
(Following your blog... maybe that will speed up the learning process...)
~Anne
February 14, 2013 at 1:01 pm #20355[email protected]
ParticipantMay I ask one more question?
The client now asks, "Can you please allow people to click on the Business or Wisdom or Nature header to bring them back to that specific page?"
Oi vey!
February 14, 2013 at 1:53 pm #20373Brad Dalton
ParticipantPlease start a new thread for new questions as it will be answered faster
February 14, 2013 at 1:59 pm #20376[email protected]
ParticipantThank you! Done...
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.