• Hello! I am fairly new to thing and am having trouble finding anything on this particular problem.

    I can not for the life of me get the_content to style with my CSS. I wrote. In fact nothing does. What am I doing wrong?

    HTML

    <?php 
    
    if( have_posts() ):
    
    while( have_posts() ): the_post(); ?>
    
    <div class="postWrapper">
    
    <a href="#"><img class="avatar" src="avatar.jpg" title="avatar" alt="avatar"/></a>
    <h4 class="titleDate"><a href="#">USERNAME </a> /<span><?php the_time('F j, Y'); ?></span></h4>
    <div class="titleWrapper"><a href="#"><h4 class="titlePost"> <?php the_title(); ?></h4></a>
    					</div>
    
    <article class=blogPost>
    
    <h3 class="hidden">Blog Post</h3>
    
    <div class="blogwordContent"> <?php the_content(); ?></div>
    
    <a href="#"><h5 class="readMore">READ MORE</h5></a>
    
    </article>
    
    </div>
    
    <?php endwhile;
    
    endif;
    
    ?>

    CSS

    section#blog article .blogPost .blogwordContent  {
    padding-right: 5%;
    padding-left: 5%;
    padding-top: 10px;
    padding-bottom: 10px;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 1em;
    font-weight: normal;
    color:#e6ddcc;
    
    }

Viewing 7 replies - 1 through 7 (of 7 total)
  • It looks like you should have

    section#blog article.blogPost .blogwordContent {
      ...
    }

    instead. Note the lack of a space between “article” and “blogPost”.

    Thread Starter mot13

    (@mot13)

    Thank you! but still no effect 🙁

    Can you post a link to a page that shows the issue?

    Thread Starter mot13

    (@mot13)

    Hello!

    Yes of course here is a link to the page which displays the problem

    http://meteorkick.com/

    The word displaying “Seven Force” is how I want the_content to look. The actual content is being displayed in the default settings.

    Hi mot13,

    Can you try the following?

    section#blog article.blogPost.blogwordContent

    Also, make sure that http://meteorkick.com/ is loading since it didn’t load when I tried!

    Cheers!

    Nirmalya’s advice won’t work, unfortunately. His code is looking for an <article> tag with the classes “blogPost” and “blogwordContent”, which isn’t what you have.

    Looking at your site, it appears that this CSS would work:

    section#blog article.blogPost {
    padding-right: 5%;
    padding-left: 5%;
    padding-top: 10px;
    padding-bottom: 10px;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 1em;
    font-weight: normal;
    color:#e6ddcc;
    }

    It doesn’t appear that you need to include “blogwordContent” in the selector at all.

    Hi stephencottontail,

    Actually the link to the website which mot13 provided, didn’t load. So, I couldn’t have a look at his website! So, I can be wrong.

    Cheers!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Div styling not hitting the_content PHP’ is closed to new replies.