WordPress.org

Ready to get started?Download WordPress

Forums

Problem with linking to post (3 posts)

  1. anandg
    Member
    Posted 7 years ago #

    I have a problem when opening a link to a post as described at http://codex.wordpress.org/Linking_Posts_Pages_and_Categories

    For instance, this doens't work
    http://www.chrismochtar.nl/anand/rolandinus/index.php?p=12

    But this does
    http://www.chrismochtar.nl/anand/rolandinus/index.php?cat=5

    Do I need some WordPress tags or code in the index.php?

  2. moshu
    Member
    Posted 7 years ago #

    You can take out the "index.php" and you'll get the same result.
    The reason:
    - the second URL (cat=5) doesn't use the physical index.pgp file but its own category template
    - seemingly you don't have a single.php template file, so the single post view is trying to use your index.php file... which (I'd bet on this) doesn't have a Loop.

    No Loop > no posts displayed.

    I'd suggest you do some reading:
    http://codex.wordpress.org/Template_Hierarchy
    http://codex.wordpress.org/Teme_Development

  3. anandg
    Member
    Posted 7 years ago #

    Ah great, I created a single.php file with a loop and now I can see the content of the specified posts in the url.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags