Jump to content


Photo

What am I missing here?


  • Please log in to reply
2 replies to this topic

#1 straightryder

straightryder

    Member

  • Member
  • PipPipPip
  • 72 posts
  • LocationVancouver BC

Posted 19 August 2010 - 01:34 AM

Okay, im trying to display 3 posts from the same category vertical fashion.

I'm only able to get 1 post to appear and its not from category 5. What gives.

I made extra space so its readable.



<div class="post2"><!--Secondary Posting For Previous Projects-->

<?php query_posts('showposts=1&cat=4'); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post-title">
<div class="ratings">Rating stars go here</div>
<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
<div class="post-date"><span class="author">Posted by <?php the_author_posts_link(); ?></span> <?php echo get_the_date(); ?></div>
</div>

<div class="post-pic"> </div>
<div class="entry">
<?php the_excerpt(); ?>
</div>
<?php endwhile; ?>
<?php endif; ?>

<div class="meta-post">
<div class="post-comments"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></div>
<span class="post-cat">Category: <?php the_category(' ') ?></span>
</div>

<div class="navigation">
<span class="previous-entries"><a href="<?php next_posts_link('Older Entries') ?>"></a></span>
<span class="next-entries"><a href="<?php previous_posts_link('Newer Entries') ?>">Next Entries</a></span>

</div>


</div>






<!--Below Are The 3 Box Posts for Current Projects-->

<div id="box3">

<div class="project-box-title"><h2>CURRENT PROJECTS</h2></div> < -- Main Container -->

<?php if (have_posts()) : while(have_posts()) : $i++; if(($i % 2) == 0) : $wp_query->next_post('cat=5&showposts=3'); else : the_post(); ?>

<div class="post3-container"><-- Left Side -->


<span class="post-date3"><?php the_date('Y/ m/ d', '', ''); ?></span>

<div class="post-title3">

<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<span class="author3">Published by <?php the_author_posts_link(); ?></span>

<div class="entry3">

<?php the_excerpt(); ?>

<?php endif; endwhile; else: ?>

<?php endif; ?>

<?php $i = 0; rewind_posts(); ?>

<?php if (have_posts()) : while(have_posts()) : $i++; if(($i % 2) !== 0) : $wp_query->next_post('showposts=1&cat=5''); else : the_post(); ?>

<div class="post3-container"> <-- Right Side -->

<span class="post-date3"><?php the_date('Y/ m/ d', '', ''); ?></span>

<div class="post-title3">

<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<span class="author3">Published by <?php the_author_posts_link(); ?></span>

<div class="entry3">

<?php the_excerpt(); ?>

<?php endif; endwhile; else: ?>

<?php endif; ?>


</div>
</div>
</div>
</div>
:blink:
  • 0

#2 Susie

Susie

    Advanced Member

  • Advanced Member
  • PipPipPipPip
  • 3,359 posts
  • LocationColumbus, OH

Posted 19 August 2010 - 04:54 AM

Okay, im trying to display 3 posts from the same category vertical fashion.

I'm only able to get 1 post to appear and its not from category 5. What gives.

I made extra space so its readable.



<div class="post2"><!--Secondary Posting For Previous Projects-->

<?php query_posts('showposts=1&cat=4'); ?>


You have showposts=1 and cat=4. Change that line to <?php query_posts('showposts=3&cat=5'); ?> and it should work for you.
  • 0

#3 Andrea

Andrea

    Advanced Member

  • Moderators
  • 5,721 posts
  • Facebook:https://www.facebook.com/aandbwebdesignAB
  • LocationSan Antonio, TX

Posted 19 August 2010 - 04:58 AM

Grace, we'll be happy to respond to you well, but please provide some specifics to what you need. For forum help, see the link in the upper right next to your profile picture.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users