WordPress.org

Ready to get started?Download WordPress

Forums

Post background color (6 posts)

  1. fufimaki
    Member
    Posted 1 year ago #

    Hi,
    I have createad a different page from the home page and I need to set the background of the post to black.
    In the CSS I have:
    .ita-post-body
    {
    padding:10px;
    }
    which I have created
    .ita-post-body2
    {
    padding:10px;
    background-color: #000000;
    }
    to use in the new page, however, when I go to the new page (php file), I see that this is the part of the code that shows what I have post:

    while (have_posts()) {
    the_post();
    get_template_part('content', 'page');
    /* Display comments */
    if ( theme_get_option('theme_allow_comments')) {
    comments_template();
    }

    When I go to see the html source code, it generates:

    <div class="ita-box ita-post post-10 page type-page status-publish hentry" id="post-10">
    	    <div class="ita-box-body ita-post-body">
    	            <div class="ita-post-inner ita-article">
    	            	                <div class="ita-postcontent">
    	                    <!-- article-content -->
    	                    <p>HERE'S WHERE MY POST SHOWS UP</p>
    	                    <!-- /article-content -->

    As you can see, the ita-post-body is on the div, where can I find that so so I can set the backgrond color to black for that class.

    Thanks
    Regards

    [Moderator Note: Please post code or markup snippets between backticks or use the code button.]

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Try using Firefox with the Firebug add-on for this kind of CSS work.
    http://getfirebug.com/

  3. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    use the css id of the next outer div: #post-10

    for instance, style:

    #post-10 .ita-post-body { }

  4. fufimaki
    Member
    Posted 1 year ago #

    esmi, I use firebug and it shows me the ita-box-body ita-post-body.

    alchymyth, I have done what you said and it worked succesfully.

    I have one more question, so on this page no matter if I delete the content UPDATE and then add a new content, the id of the post will always be 10 or should I be aware of the change?

    Thanks you to both of you
    Regards

  5. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    as long as you don't trash the post/page, the ID should remain the same.

  6. fufimaki
    Member
    Posted 1 year ago #

    Great, once again, thanks a lot.

    Best Regards

Topic Closed

This topic has been closed to new replies.

About this Topic