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  123456elliott@gmail.com 1 year, 5 months ago.

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

    123456elliott@gmail.com
    Participant
    Post count: 10

    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!
    ~Anne

    #20032

    braddalton
    Participant
    Post count: 8797

    http://my.studiopress.com/snippets/custom-body-class/

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


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #20164

    123456elliott@gmail.com
    Participant
    Post count: 10

    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!

    ~Anne

    #20254

    braddalton
    Participant
    Post count: 8797

    Its already added it in your child themes functions.php file.

    You can grab the body class from your source code:
    [html]
    <body class="archive category category-business category-3 custom-background custom-header header-full-width full-width-content custom-class">
    [/html]

    I tested this and it works:
    [css]
    .category-business {
    background: yellow;
    }
    [/css]


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #20335

    123456elliott@gmail.com
    Participant
    Post count: 10

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

    ~Anne

    #20355

    123456elliott@gmail.com
    Participant
    Post count: 10

    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!

    #20373

    braddalton
    Participant
    Post count: 8797

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


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #20376

    123456elliott@gmail.com
    Participant
    Post count: 10

    Thank you! Done…

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

You must be logged in to reply to this topic.