WordPress.org

Ready to get started?Download WordPress

Forums

Echo dynamic page id in a query with magic fields (1 post)

  1. robmuzo
    Member
    Posted 3 years ago #

    Hi guys,
    I'm developing a site using the magic fields plug-in for custom write panels.

    Basically what I need to do is a query with an id that is created dynamically rather than actually putting the page id in. When the user selects a related field in magic fields it fires out the page id. and then I echo that in the theme template like this:

    <?php echo get ('user-selected-page-id');?>

    The user-selected-page-id generates the page id dependant on what the front end user selects.

    <?php query_posts('page_id=7');?>

    What I need to do is put the echo code where the number 7 is ie:

    <?php query_posts('page_id=<?php echo get ('user-selected-page-id');?>');?>

    I know that's completely wrong but I am just trying to illustrate what I need to do.

    Any Ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic