WordPress.org

Ready to get started?Download WordPress

Forums

Permalinks don't work for "recent posts" section (6 posts)

  1. gleem
    Member
    Posted 9 years ago #

    after adding this to my permalinks:
    "/%category%/%postname%/"

    everything seems to work ok, except on the index page my "recent posts" section won't update to use the new code, and all the links break I guess because they still have this structure:
    "/blog/?p=5"
    but when I got a perma page I wrote instead of an article, the links appear in the "recent posts" section with the correct permalink structure?

    anyone have this problem?

  2. gleem
    Member
    Posted 9 years ago #

    bump for the after work hours crew

  3. Kafkaesqui

    Posted 9 years ago #

    This should take care of it:

    http://guff.szub.net/source/sidebar-26440.php

    (Other changes related to this thread).

  4. gleem
    Member
    Posted 9 years ago #

    I get:
    Parse error: parse error, unexpected T_STRING on line <b>49</b>

  5. Kafkaesqui

    Posted 9 years ago #

    And once again I can't duplicate it. What file is being specified in the error? Line 49 in my sidebar.php is:

    $post->post_title = sprintf(__('Post #%s'), $post->ID); ?>

    Which is straight from yours. And the whole section of the file:

    <?php
    foreach ($recentposts as $post) {
    if ($post->post_title == '')
    $post->post_title = sprintf(__('Post #%s'), $post->ID); ?>
    <li><a href="<?php echo get_permalink($post->ID); ?>"><?php the_title(); ?></a></li>
    <?php } ?>

  6. gleem
    Member
    Posted 9 years ago #

            yes, this is the line it has a problem with:
    line 49:        $post->post_title = sprintf(__('Post #%s'), $post->ID); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.