Forums

Dynamic Links (3 posts)

  1. Montano5
    Member
    Posted 1 year ago #

    Hello to all!

    I've just made a blog and portfolio site with Wordpress and I have a little problem with dynamic links on home page.
    http://www.pierrejeansuau.com

    As you can check on my site, the tags are on the right and clickable and then the site display other post with same tags.
    For the tags to work, I have to set the 'Blog Pages' 'Show at most' to '10' in Option --> Reading.
    But I want that the home page display only 1 post. So I add this code:
    <?php query_posts($query_string . "&showposts=1"); ?>

    But then, I have a problem with navigation. I use these code:
    <div id="navigation">
    <div class="alignleft"><?php previous_post_link('« %link') ?></div>
    <div class="alignright"><?php next_post_link('%link »') ?></div>
    </div>
    In Fact the home page doesn't display the links at all but show an empty space instead.

    I don't understand because when you click on 'comment' then the same code display the previous post with the title.
    But only when you click on 'comment'...
    So I have to add the link for previous post on the post itself with the html link command. Not easy and not nice...

    Anyone got an idea for what I do wrong?
    And sorry for my bad english.. :)

    Thank you all !
    Pierre-Jean

  2. furiousphotographers
    Member
    Posted 1 year ago #

    I am trying to do the same thing with my theme. I want to get a dynamic link out, so that I could give away my wedding photography blog theme.

  3. iridiax
    Member
    Posted 1 year ago #

    Use posts_nav_link on index, category, and archive pages.

Topic Closed

This topic has been closed to new replies.

About this Topic