$4
Content wont update
Is it because it's a 'page' that is queryng a category? Url changes but content always stayes the same.
here is the url of the page
http://aussisimple.com/clients/inpix/boutiques
<div id="content">
<div class="Box">
<?php the_content(); ?>
</div>
<div class="box">
<div class="separator"></div>
<?php
$query = 'cat=4&orderby=title&order=ASC&posts_per_page=2';
$queryObject = new WP_Query($query);
// The Loop...
if ($queryObject->have_posts()) {
while ($queryObject->have_posts()) {
$queryObject->the_post(); ?>
<div class="shopName"><h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3></div>
<div class="shopDesc"><?php echo cutMe(get_the_excerpt()); ?></div>
<ul class="shop">
<li class="uppercase"><?php echo get('location_shop', 1); ?></li>
<li><?php echo get('tel_shop', 1); ?></li>
<li><?php echo get('siteweb_shop', 1); ?></li>
</ul>
<div class="separator"></div>
<?php }
}
?>
<div class="navigation">
<?php if (function_exists('wp_snap')) { echo wp_snap(); } ?>
<!--?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?-->
</div>
</div>
</div>
Roberto Mas | 05/24/10 at 12:19am
| Edit
(4) Possible Answers Submitted...
Note: Roberto Mas felt their question was unanswered, so we granted them a refund.
Note: Roberto Mas requested a refund. They offered no explanation.
-

Last edited:
05/24/10
1:28amNavjot Singh says:Are you sure that this is the only reason? Tried removing wp-snap/wp-pagenavi codes and replace with generic navigation code?
- 05/24/10 11:14am
Roberto Mas says:Genric navigation doesent work eighter
- 05/24/10 11:14am
-

Last edited:
05/24/10
2:20amStew Heckenberg says:The line that controls what content gets returned is:
$query = 'cat=4&orderby=title&order=ASC&posts_per_page=2';
According to the WordPress Codex page about query posts, this means:
"get me items from category with ID 4, order (sort) them by their title, make this ordering ascending (i.e. A to Z), and display 2 items"
If new posts don't have the category with ID 4, then they won't be included. If you want to display pages instead of posts, add '&post_type=page' to the $query variable above. If you want both posts and pages make it '&post_type=any' -- by default it will return just posts.
So my guess is that the posts that aren't showing up like you expect don't have category with ID 4.
- 05/24/10 11:17am
Roberto Mas says:i have about 10 items (posts not pages) for now in cat 4. Im only displaying 2. WHen i click the navigation link i want to display the other results depending of the letter.
http://aussisimple.com/clients/inpix/boutiques - 05/24/10 7:57pm
Stew Heckenberg says:Roberto, your initial post asked about why it was displaying the same 2 posts -- you didn't ask how to display all posts for a particular letter...
...that said, if you remove the "posts_per_page=2" part from the query it should display all posts for that query, or perhaps change that number to something bigger like 20 or 200.
- 05/24/10 11:17am
-

Last edited:
05/24/10
9:26amNoah Coffey says:It could be that your navigation area (which is using WP_Query) is occuring inside the main loop on that page. Try moving it outside the main loop and see if it works. If so, you'll need to restructure your page to make sure you are not looping inside the main loop.
If you are indeed creating a 2nd loop inside the main page loop, calls like the_title(); can confuse Wordpress and it won't know which loop to take them from. -

Last edited:
05/25/10
8:48amRashad Aliyev says:
<?php query_posts("cat=-1&showposts=15&paged=$paged");?>
<?php while (have_posts()) : the_post(); ?>
your styled code here.. for examle .. <?php the_title(); ?> as you wish...
<?php endwhile; ?>
<div style="clear:both" ></div>
I give code for pagging.. there are as you see cat=-1 (not showing category as you wish) and showposts=15 (15 post showing) and pagging.. paged=$paged for WP-PageNavi plugin.
As you see you've only need paged=$paged.
That's all!!..
Previous versions of this answer: 05/25/10 at 8:46am | 05/25/10 at 8:48am
This question has expired.
Current status of this question: Refunded




