• Hello,

    Im new to wordpress, I think there is something wrong w/ my blog design, its because when i put a background color to my blog title .. the whole article is being affected by the background color..

    Here’s the code
    php code*

    <?php get_header(); ?>
    <div id="featured"><?php slidedeck( 171 ); ?></div>
    <div id="content">
    
    <?php query_posts("posts_per_page=5"); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    
    <h2 class="post-title"><a>"><?php the_title(); ?></a></h2>
    
    <?php include (TEMPLATEPATH . '/inc/meta.php' ); ?>
    
    <div class="entry">
    <?php the_excerpt(); ?>
    <div id="read"><a>"> <img src="<?php bloginfo('template_directory'); ?>/images/read-more.jpg" /> </a></div>
    </div>
    
    </div>
    <?php endwhile; ?>
    <!-- <?php include (TEMPLATEPATH . '/inc/nav.php' ); ?> -->
    <?php else : ?>
    
    <h2>Not Found</h2>
    
    <?php endif; ?>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    css**

    /**********************************************
    Blog Posts
    ***********************************************/

    .post { margin: 0 10px 10px 0; }
    .post a { font-weight: normal; }
    .post h2, .post h2 a, .post h2 a:hover { border: 0; margin: 0 10px 0 0; }
    .post h2 a:hover { text-decoration: underline;}
    .meta { color: #000; margin: 5px 0 10px 0; font-size: 9px; font-style: italic;
    background: #fafafa; padding: 2px 2px 2px 2px;}
    
    .post-title { color: #000; font-size: 22px; padding: 0; margin: 30px 0 0 0; }
    .entry { font-size: 12px; line-height: 20px; display: block; padding: 0 0 40px; 0; float: left; margin: 20px 20px 0 0; font-weight: normal; }
    .entry img { margin: 0 10px 5px 0; border: solid black 1px; padding: 1px 1px 1px 1px; }
    
    #read {
    float: right;
    }
    
    #read a:hover img {
    text-decoration: none;
    }
    
    #content .separator {
    height: 16px;
    width: 680px;
    background: url(images/separator.jpg);
    }
    
    #featured {
    padding: 5px;
    border-bottom: 5px solid black;
    background-color: #fffff;
    }

    —- like i said. not sure whats happening? help? and if you can improvise it and remove unnecessary codes, kindly do. my coding aint that clean yet.

    Thanks a lot

Viewing 5 replies - 1 through 5 (of 5 total)
  • please use the ‘code’ button to mark your code.

    when i put a background color to my blog title .. the whole article is being affected by the background color..

    i can’t see any background style for the post title – unless you refer to the top blog title, in which case you have posted the wrong template and css – the blog title is more likely in header.php

    can you give more details and post a link to your site to illustrate your problem?

    Thread Starter jeremi_liwanag

    (@jeremi_liwanag)

    oops sorry bout that. yeah anyway here is the site

    i want to add a background color in my blog title just like the meta.

    .post-title { color: #000; font-size: 22px; padding: 0; margin: 30px 0 0 0; background: #fafafa }

    Thread Starter jeremi_liwanag

    (@jeremi_liwanag)

    and can you tell if there is something wrong with my loop and css codes?

    i’m currently editing it offline using wamp.

    its because when i put a background color to my blog title .. the whole article is being affected by the background color..

    it is because of the way some elements of the post are floated, and others are not.

    try:
    .post-title { color: #000; font-size: 28px; padding: 0; margin: 30px 0 0 0; clear:both; background: #fafafa; }

    and can you tell if there is something wrong with my loop and css codes?

    check your code with:
    https://validator.w3.org/
    https://jigsaw.w3.org/css-validator/

    Thread Starter jeremi_liwanag

    (@jeremi_liwanag)

    oh! thats why when i put floats on my title and entry divs… they’ve collapsed. i going to validate it first.

    How about my loop? is it ok?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘not sure if css or wordpress codex …help??’ is closed to new replies.