WordPress.org

Ready to get started?Download WordPress

Forums

remove posts borders on an individual post? (5 posts)

  1. Innovnate
    Member
    Posted 2 years ago #

    Hi all you smart people!

    I have a blog: blog.seed3.com.au

    which uses the following snippet of code (already from you smart people)

    body.category .post { padding: 35px 0px 25px 0px!important;
    width: 841px;
    padding: 12px !important;
    border: 1px solid #b1b1b1;
    margin-bottom: 15px;

    to give each post a thin grey border. This is great, but how can I 'turn it off' on a specific post? Ie in my case, I would like to put in a purely text post, and this does not need a border!

    Appreciate any help!

    Nate

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    at the moment, you can't, as your theme does not output any post specific css ids or classes.

    you might need to edit the loop of your template and change this line:

    <div class="entry post clearfix">

    for example to something like this:

    <div class="entry post <?php echo 'post-'.get_the_ID(); ?> clearfix">

    you could then use:
    body.category .post.post-357 { border: none; }
    to remove the border (the number is the post ID of the respective post)

  3. Innovnate
    Member
    Posted 2 years ago #

    ok, so I made the change to the blog page.php, then I put the body.category .post.post-357 { border: none; } code in the style.css

    Is that right - because it doesn't seem to work? I'll try putting the code into the blog page.php next and see :)

  4. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    page.php is not the likely template as it is responsible for static pages http://codex.wordpress.org/Template_Hierarchy

    possibly index.php

  5. Innovnate
    Member
    Posted 2 years ago #

    Thanks for your help - I have managed to get the border off in the category page, but not in the home page... cannot find anymore references to <div class="entry post clearfix"> in any of the pages to change over :(

    entry.php was the one that changed the category post though fyi :)

Topic Closed

This topic has been closed to new replies.

About this Topic