• Hi,
    I’m using a plugin that adds tags to pages as well as posts (TagPages), and am wanting to retrieve those tags on a page prior to clicking though to the individual tagged pages.

    I am including content from another database ,which is going through a while loop and spitting out a list of items, each of which has an associated WP page id (so I know the page IDs already)

    The only thing I can find that seems related is this:

    $postid = $post->ID;
    get_the_tags($postid);

    As I said, I already know the WP page id’s at this stage so am unsure how to use it; I managed to make it say ‘array’ at one point, (but can’t seem to do it again…)
    Any help gratefully received!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter smoo

    (@smoo)

    Hi again,
    I’ll try asking another way:

    Is it possible to get the tags for a specific page/post when you’re not actually on that page/post, provided you know the page/post id?

    Thanks in advance!

    dains

    (@dains)

    Hi Smoo. I found this while fishing around for an explanation of $post->ID (does that mean variable $post gets the ID, or does it mean $post assigns its value to ID – can’t find the -> operator explained anywhere).

    I do know that pages use post IDs. And you can initialize both the main loop using query_post and other loops using wp_query and set the post ID argument for them and they’ll start from there. So yes, you can generally get any information for any pages that is available in the Loop, and I’m pretty sure that includes tags.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get tags for a page using page id’ is closed to new replies.