[resolved] Creating a variable for meta id (4 posts)

  1. robmuzo
    Posted 5 years ago #

    Hi Guys I need to be able to create a wordpress query which queries the id of the page from a meta input, I have been told this can be done by putting it in a variable but have not used variables before so am unclear how to do this.

    so bassically what im looking for is this:

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

    with the page id coming from a meta which is usually pulled into the page like this:

    <?php echo get ('dynamic-meta-page-id');?>

    Any ideas how I can get the query to have the meta output in it instead of a fixed number (7)

    I have been trying to do this since yesterday but just cant make it work.



  2. forunner
    Posted 5 years ago #

    I'm not sur to understand the problem [good explanation, but I'm french]
    If I understand :
    try this

    <?php $variable = get('dynamic-meta-page-id');
  3. robmuzo
    Posted 5 years ago #

    Yes Thanks a lot that did the trick, so simple but so difficult if you haven't done it before.

    Thanks for you help, life saver.:)

  4. forunner
    Posted 5 years ago #

    good =)

    (don't forget the "resolved" )

Topic Closed

This topic has been closed to new replies.

About this Topic