WordPress.org

Ready to get started?Download WordPress

Forums

query_post for Child page or Page with - or — in it creates error (2 posts)

  1. jsml
    Member
    Posted 4 years ago #

    Hello, I was trying to use this tag:

    <?php
    query_posts('pagename=parent/child'); // retrieve the child page of a parent
    ?>

    as seen on http://codex.wordpress.org/Template_Tags/query_posts

    However, when I do—for example—the following, I get errors (as in, the page does not get called and it instead shows the text for "nothing posted yet")

    pagename=about/history
    or
    pagename=about-history
    or
    pagename=about-—-history

    They all won't bring up the post...

    The only pagename tag that I can get to work is when the title has no dashes in it...

    Any help, please???

    Many thanks!

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Try using:

    <?php query_posts('pagename=child');?>

Topic Closed

This topic has been closed to new replies.

About this Topic