I am having trouble getting pagination to work on in my front-page.php with a Custom Post Type.
The way the page is constructed is rather unique. There are 3 loops.
The first:
Used to show only 2 posts of a specific category.
The second:
Used to show only 1 post of a specific category.
The third:
The “main” loop showing all of my uncategorized Custom Posts.
The main loop (the third one) is what I need pagination on. The first two loops need no pagination. I have pasted all of my front-page.php in the link below:
https://pastie.org/4160693
Any help would be greatly appreciated. Thanks.
]]>Hopefully someone can help me get to the bottom of some rather strange 404 behaviour.
I’ve got a site which is currently in development … https://www.967atc.co.uk/wordpress/
My php / html coding isn’t exactly the cleanest you may have ever come across (it grows very organically!), but up until now it seems to have worked quite well.
My problem is that I get random ‘positives’ on is_404() when using pagination links. For instance here…
https://www.967atc.co.uk/wordpress/category/activities/page/3/
Page 2 and 1 work fine, but as soon as you go to page 4 it gives the 404.
The site runs two loops, the first checks if you’re is_category()
, is_404
, is_home()
, is_search()
etc and displays a single pane with relevent content. The second loop runs the ‘real’ query and displays the resulting output. It appears that the first query is getting a True on is_404() and as such displaying my 404 pane (‘Negative Ghostrider…’).
I have no idea where to start with debugging this, can anyone give me any pointers?
Thanks
Jamie
]]>
So this far in I guess you know that the first div content-left contains the entire box which contains the first second and third row div's, in each and every one of those rows are 3 other div's and each of those 3 div's represents 1 post, how can I use the multi loop code to make the posts show up like I want them in the styling and order that I want them, and without diplicating?
]]>I have just put this dual loop in my tag.php, its working and from reading the documentaion i think ive done it properly but could somebody please check incase ive made an error or incase there is a better way to do it:
<?php if (have_posts()) : ?>
<?php $posts = query_posts($query_string . '&cat=-100&showposts=100'); while (have_posts()) : the_post(); ?>
Loop 1 Stuff...
<?php endwhile; ?>
<?php rewind_posts(); ?>
<?php $posts = query_posts($query_string . '&cat=100&showposts=100'); while (have_posts()) : the_post(); ?>
Loop 2 Stuff...
<?php endwhile; ?>
<?php else : ?>
My Error Stuff 404 Message...
<?php endif; ?>
The top loop is set to exclude a category and the second is set to include the category the first loop excluded.
Adding or removing <?php rewind_posts(); ?> doesnt seem to make a difference but i left it there as i read it was required.
Does it matter having $posts for each loop or do i need to name each loop differently im not sure how that works for query_posts.
The showposts=100 is just there to make sure all the posts for the tag show on the one page, in reality there will probably only 10-15 posts per tag but again i read using a higher number is fine as it will just stop if it runs out of posts before it gets to 100 so is this ok also.
Thanks in advance for any help or advice.
Nick
]]>to put the “about” page on the first column i have used this inside a tr tag:
<?php query_posts('pagename=about'); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php endif; ?>
after which I have tried to put the other classic loop
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
………
<?php endwhile; else: ?>
<p><?php _e(‘Sorry, there aren\’t any posts that match what you requested.’); ?></p>
<?php endif; ?>
and so on, to fill the other cells.
Is there another way to call a specific page to be used outside the loop ?
]]>What I’m having a hard time doing is the split. Getting a multi-loop split via categories is easy, but how do you identify even or odd posts and exclude either from a loop?
Thanks
]]>