• Resolved deuk

    (@deuk)


    Hello,

    I’ve started making my own theme for my website, but now I ran into a problem. Everything worked out fine except for the the_content(”) part. Somehow the class it’s supposed to have doesn’t apply to it, here’s my code:

    <?php
    
    get_header(); ?>
    
            <div class="clear"></div>
          <div id="content-left">
           	  <h1>Professional Design</h1>
    
    	<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
                <img src="wp-content/themes/robindebije/images/temp-thumb.gif" width="189" class="news-img" />
    
            <div class="news-container-right"  id="post-<?php the_ID(); ?>">
                	<p class="news-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
              <p class="author"><?php the_author() ?></p>
                    <p class="date"><?php the_time('F jS, Y') ?></p>
    
    <p class="news-content">
    <?php the_content(''); ?>
    </p>
    
    				<p class="view-full-article"><a href="<?php the_permalink() ?>">View full article</a></p>
                    <p class="view-comments"><?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
            </div>
                <div class="clear"></div>
    
    		<?php endwhile; ?>
    
    			<p class="older-or-newer"><?php next_posts_link('&laquo; Older Entries') ?></p>
    			<p class="older-or-newer"><?php previous_posts_link('Newer Entries &raquo;') ?></p>
    
    	<?php else : ?>
    
    		<h2 class="center">Not Found</h2>
    		<p class="center">Sorry, but you are looking for something that isn't here.</p>
    		<?php get_search_form(); ?>
    
    	<?php endif; ?>
          </div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    This is the part it’s all about

    <p class="news-content">
    <?php the_content(''); ?>
    </p>

    When I view my site the content doesn’t seem to use any CSS of the news-content class, which it should.
    Hope you can help me, first time I make a theme 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • what’s the css for .news-content ?

    and a link to your site will help, too.

    Thread Starter deuk

    (@deuk)

    p.news-content {
    	color: #878686;
    	font-size: .8em;
    	display: block;
    	margin-top: 30px;
    	clear: both;
    	line-height: 14px;
    }

    Link: http://www.robindebije.com

    But I got it fixed another way, just had to put the info in the body and give all the other text their own class. Probably way too much work, so if someone could explain how to just give the content a class I would appreciate it very much 🙂

    [EDIT]
    Oh wait.. it still doesn’t work, when I change it in body everything changes with it. So help is still needed! 😀

    here is the problem: (from the html of your site)

    <p class="news-content">
    </p><p>Ik heb de layout nu...

    the ‘p class=”news-content”‘ gets closed immedeately with the closing /p.
    this is going to be an ongoing problem, as the content will contain lots of different html tags, that will close your starting <p>.

    is there any reason you could not use:

    <div class="news-content">
    <?php the_content(''); ?>
    </div>

    and then style that accordingly?

    Thread Starter deuk

    (@deuk)

    I’ll go try that, last time I tried to do that everything mixed up lol. I’ll post when I get some results!

    Thread Starter deuk

    (@deuk)

    Ah yea thanks buddy, it worked! I know what went wrong last time i tried using the div, I forgot to add a . in front of news-content in the CSS file. Thanks for helping me out! 😀

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Class for the_content’ is closed to new replies.