WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Previous/Next Post links broken after move from WordPress.com (20 posts)

  1. saturnine
    Member
    Posted 6 years ago #

    I made a move from a WordPress.com blog to my own hosted install recently (http://sorenara.ikimashou.net/) and I've noticed that my new posts, dating from the 1st of July onwards, don't work properly with regards to the Previous and Next post links after the post itself; they seem to point to a particular post made before the move, ignoring chronological order.

    I did a search on the forums before posting and couldn't find anything of much help, so I'd appreciate it if anyone could shed some light on this matter. Thanks.

  2. Trent Adams
    Member
    Posted 6 years ago #

    Do you have a URL of your old blog address and an example to compare?

    Trent

  3. Trent Adams
    Member
    Posted 6 years ago #

    After looking at your new blog, the 'next' and 'previous' links seem to work properly as it is going chrnologically through your blog.

    Trent

  4. saturnine
    Member
    Posted 6 years ago #

    Sure.

    Old blog: http://rule41.wordpress.com/

    Another blog running the same theme (freshy2), with Next/Previous post links working as intended: http://natsuneko.animeblogger.net/

    Hope that helps.

  5. Trent Adams
    Member
    Posted 6 years ago #

    I am sorry, but I am lost. The blog posts are in the same order and the previous and next buttons on the main page follow through in order. Am I looking the right place? Do you have a 'specific' example?

    Trent

  6. saturnine
    Member
    Posted 6 years ago #

    I was referring to the Previous and Next post links after a post, ugh, not the main page links. My apologies if I wasn't clear enough on that matter, but I thought I was.

    Here's a specific example: my latest post http://sorenara.ikimashou.net/2007/07/12/claymore-as-rurouni-kenshins-spiritual-successor/ links to http://sorenara.ikimashou.net/2007/06/21/re-reading-rurouni-kenshin-sudo-vs-shinsen-and-a-theory-on-heis-contract/ as a previous post, when it should be linking to http://sorenara.ikimashou.net/2007/07/02/elitism-and-the-anime-blogosphere-anime-elitism-as-a-social-construct/
    instead.

    A second example: this post http://sorenara.ikimashou.net/2007/06/22/six-blogs-you-probably-arent-reading-yet/ should link to http://sorenara.ikimashou.net/2007/06/21/re-reading-rurouni-kenshin-sudo-vs-shinsen-and-a-theory-on-heis-contract/ as a previous post, but what it does is it states that http://sorenara.ikimashou.net/2007/05/30/it-wasnt-lupus/ is the previous post before it, which is obviously wrong, as you can tell by the list of Recent Posts on the sidebar.

  7. Trent Adams
    Member
    Posted 6 years ago #

    Yikes, that is a major issue. For testing purposes, does it do that if you quickly switch back to one of the default themes? As well, in post.php what is the exact code that is in there for next and previous calls in your theme?

    Trent

  8. saturnine
    Member
    Posted 6 years ago #

    I changed the blog theme to WordPress Default 1.6, and it's working fine, so I'm guessing it's a theme problem we're dealing with here?

    That being said and done, I have no idea how to look for next and previous calls, although I did find post.php; maybe you could instruct me on that.

  9. Trent Adams
    Member
    Posted 6 years ago #

    Sure, from the default theme the calls look like this:

    <div class="navigation">
    <div class="alignleft"><?php previous_post_link('&laquo; %link') ?></div>
    <div class="alignright"><?php next_post_link('%link &raquo;') ?></div>
    </div>

    If you go to your Admin => Presentation => Theme Editor you can switch over to your theme and look for 'post' or 'single post' or whatever the name is and compare what it has for the 'previous_post_link' function and 'next_post_link' function. Just to compare if they are the same or not.

    Trent

  10. saturnine
    Member
    Posted 6 years ago #

    <p class="navigation">
    <span class="alignleft"><?php previous_post_link('&laquo; %link','%title',true) ?></span>
    <span class="alignright"><?php next_post_link('%link &raquo;') ?></span>
    </p>

    Those are the closest matches. From single.php.

  11. moshu
    Member
    Posted 6 years ago #

    'post' or 'single post' or whatever the name is

    Wrong! It must be single.php - for displaying single posts. If it doesn't exist, WP will use the index.php -> learn about the Template_Hierarchy!

  12. moshu
    Member
    Posted 6 years ago #

    Well, that 'true' = means in the same category, and that's exactly waht blog is doing. Jumping to the previous posts in the same category!

  13. Trent Adams
    Member
    Posted 6 years ago #

    It does exist though moshu I think. In my template, 'single post' links to editing single.php is all I was getting at. (in theme editor)

    EDIT: Nice work picking out the exact template call ;)

    Trent

  14. moshu
    Member
    Posted 6 years ago #

    It probably exist; I just couldn't agree with your "whatever the name is" statement. There are certain filenames in a WP theme that has to follow the naming convention. One of those is single.php. Not whatever!

  15. Trent Adams
    Member
    Posted 6 years ago #

    Fair enough and I am not arguing. Just have found most themes have the 'hot name' in the theme editor
    (in admin) that is not 'single', but links to editing single.php anyways. Strange stuff as they should just name the file 'single' to avoid this kind of confusion (including myself).

    Trent

  16. saturnine
    Member
    Posted 6 years ago #

    moshu: So I should remove that 'true' part to fix the problem? Otherwise I can't really infer the solution from what you said back there. It's all Greek to me.

  17. moshu
    Member
    Posted 6 years ago #

    Yes, you should remove it. Useful reading:
    http://codex.wordpress.org/Template_Tags/previous_post_link

    (the rest about the single.php file was for Trent :)

  18. moshu
    Member
    Posted 6 years ago #

    Trent,
    oh, I see where are you coming from. I barely use the online theme editor and I am vehemently opposing its use (never advice any half-knowledgeable user to edit files online because they would forget to change back the permissions, leaving their site vulnerable...)
    Otherwise it is a mystery for all of us why certain files in that editor have "fancy" names (e.g. Main Index Template) while other show up with their filename: functions.php.

  19. Trent Adams
    Member
    Posted 6 years ago #

    Glad you figured out what I was talking about because I was starting to lose my own mind.

    Trent

  20. saturnine
    Member
    Posted 6 years ago #

    I did as you said, and wow, it's fixed! Thanks so much, Trent, moshu. I appreciate the real-time advice and your help. Thanks again. Can't believe it's just an hour since I started this topic.

Topic Closed

This topic has been closed to new replies.

About this Topic