Support » Fixing WordPress » Unique post formatting by category

  • Resolved bethdean


    Hi There,
    I’m a PHP noob, and I’m afraid the codex wasn’t much help either. Basically what I want to do is this: On my index display posts with a category of 31 (remaindered links) without a title category, or comments (the top and bottom pretty much.) Then I want to display all other categories normally. Here’s the code I currently have in place:

    <?php $posts = get_posts( "numberposts=10" ); ?>
        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    		<p>testing testing 123</p>
    		<h2><?php the_title(); ?></h2>
    			<div class="entrytext">
    				<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    				<?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
    	  <?php endwhile; endif; ?>
    	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
  • The topic ‘Unique post formatting by category’ is closed to new replies.