WordPress.org

Ready to get started?Download WordPress

Forums

Post on Page - Permalink don't work (2 posts)

  1. chrismise
    Member
    Posted 7 years ago #

    I add this code to have the archive of post on category 5 on a static page(using mini loop).

    Almost everything worked, but when a click on a permalink of a post that don't redirect to the post, but to the top static page.

    How can i make to permalinks inside posts go to the respective posts, not to top page

    <div>
    <?php
    $posts = get_posts('category=5');
    foreach($posts as $post) :
    setup_postdata($post);

    echo '<div id="wallpapers">';
    the_content();
    echo '<div id="wallassin"><div class="alignleft">por <a href="http://www.chrismise.com/blog/?author=';
    the_author_ID();
    echo '">';
    the_author();
    echo '</div><div class="alignright">info <a href="';
    the_permalink();
    echo '" rel="bookmark" title="mais detalhes">+';
    edit_post_link('Edit', ' <span class="barra">|</span> ', ' <span class="barra">|</span> ');
    echo '</div><div class="spacer"></div></div></div>';
    endforeach; ?>
    <div class="spacer"></div>
    </div>

  2. chrismise
    Member
    Posted 7 years ago #

    when i place the code inside de php code of the page the permalink works, but when i place the code on the page content the permalinks goes to the top of the page

Topic Closed

This topic has been closed to new replies.

About this Topic