Community Forums › Forums › Design Tips and Tricks › Customizing Category Archive Content Post entries
This topic contains 7 replies, has 2 voices, and was last updated by 123456elliott@gmail.com 3 months ago.
-
AuthorPosts
-
February 12, 2013 at 4:56 pm #19943
At 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 #20032http://my.studiopress.com/snippets/custom-body-class/
Add a custom class for cat archives and change the padding.
WordPress Developer & Consultant
Brad Dalton @ WP Sites – Click Here to Get Genesis Child Theme Tips Delivered.February 13, 2013 at 4:34 pm #20164Brad, 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 #20254Its 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; }
WordPress Developer & Consultant
Brad Dalton @ WP Sites – Click Here to Get Genesis Child Theme Tips Delivered.February 14, 2013 at 11:13 am #20335Ahhhh…. 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 #20355May 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 #20373Please start a new thread for new questions as it will be answered faster
WordPress Developer & Consultant
Brad Dalton @ WP Sites – Click Here to Get Genesis Child Theme Tips Delivered.February 14, 2013 at 1:59 pm #20376Thank you! Done…
-
AuthorPosts
You must be logged in to reply to this topic.