Forums

[resolved] My navigation's links are linking incorrectly (13 posts)

  1. danaldinho
    Member
    Posted 2 years ago #

    Hey,

    At the bottom of my blog ( http://www.lilwaynehq.com ) the navigations links (previous and next) do not work.

    When you click on them, it just brings up the 404 page :(

    Anyone know what the problem is and how I can fix them?

    The code I am using is:

    <div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
    			<div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
    		</div>

    Thanks :)

  2. whooami
    Member
    Posted 2 years ago #

    they work for me.

  3. danaldinho
    Member
    Posted 2 years ago #

    Sorry, I should of been clearer.

    They work, but they display the first pages posts again :(

    Instead of displaying the next 5 posts etc.

  4. whooami
    Member
    Posted 2 years ago #

    ok, what happens when you switch to the default theme?

  5. danaldinho
    Member
    Posted 2 years ago #

    It works when I use the default theme.

  6. whooami
    Member
    Posted 2 years ago #

    well then take that theme back to the guy who made it, or fix it yourself?

    compare the default theme to the custom theme. whats different? Put on your thinking cap ...

  7. danaldinho
    Member
    Posted 2 years ago #

    Obviously I have tried looking myself.

    The code is exactly the same as I posted above ^

    So I am wondering what other files I need to edit... like would it be some functions in the includes I need to edit.

  8. danaldinho
    Member
    Posted 2 years ago #

    Ok, I contacted the people who made the theme and they told me that it is something to do with my wordpress files.

    So, could someone please point me in the right direction to see why these links aren't working. Like what files should I check and see if they are similar from a theme that has the links working to my theme.

    Thanks.

  9. Mark / t31os
    Moderator
    Posted 2 years ago #

    No it's not your WordPress files, that's clearly evident from the fact it works when switching theme...

    I can take a stab in the dark and guess by saying that the problem lies in some custom query in the theme files...

    Do you have a latest posts query or something like that just before those links? Or maybe somewhere else in theme file?

  10. danaldinho
    Member
    Posted 2 years ago #

    I thought it might be something to do with the queries, but I just wasn't 100% sure.

    I looked and I think it will be something do with this

    <?php
    	include(TEMPLATEPATH . '/includes/version.php');
    
    	$the_query = new WP_Query('cat=-'. $ex_feat . ',-' . $ex_vid . ',-' . $ex_aside . '&showposts=' . $showposts . '&orderby=post_date&order=desc');
    	$wp_query->in_the_loop = true; // Need this for tags to work
    	while ($the_query->have_posts()) : $the_query->the_post(); $do_not_duplicate = $post->ID;
    ?>

    What do you think? and this code was at the very top of my file.

    Thanks :)

  11. Mark / t31os
    Moderator
    Posted 2 years ago #

    It could very well be related...

    Only way to know is to test, remove/modify, test, rinse and repeat...

  12. danaldinho
    Member
    Posted 2 years ago #

    I tried removing it and brings up an error on the blog.

    I do think I need that piece of code, but I will just have to modify it.

    But I have no idea what to add for the prev and next links.

    So could someone help me out with that :)

    Thank you.

  13. Mark / t31os
    Moderator
    Posted 2 years ago #

    I'd imagine it's a matter of ensuring your previous and next code is within the same loop as the post/page being displayed...

    Otherwise the links are sort of saying "Previous/Next post based on what, we don't know where we currently are.."

    I could be wrong...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.