Customizing Category Archive Content Post entries

Community Forums Forums Design Tips and Tricks Customizing Category Archive Content Post entries

This topic is: resolved

This topic contains 7 replies, has 2 voices, and was last updated by 2 years, 9 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #19943

    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:

    Is there any easy way to customize the category archive page like this?
    Thank you!



    Add a custom class for cat archives and change the padding.


    Brad, 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!




    Its 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;


    Ahhhh…. 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…)



    May 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!



    Please start a new thread for new questions as it will be answered faster


    Thank you! Done…

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.