Jump to content
Stef's Coding Community

What am I missing here?


Recommended Posts

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:

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...