Support » Plugins » Querying a post’s info in multiple locations within a page?

  • I am attempting to setup the (single post) page with the title and content in the main content <div> and have the custom fields, category, date etc.. display just to the right in the sidebar. I could manaully code this in, but it would disrupt the commentform as located before it are the endif and endwhile calls to end the loop.

    Thus, is there a way in which I can resetup the postmeta(?) data for use in another location outside the loop in such a way that it could be setup to automatically retrieve the data per whichever post the user may be viewing?

    Actually, wouldn’t it work to just store the category to a variable like $temp_category and call that from a different location outside of the loop?

Viewing 2 replies - 1 through 2 (of 2 total)
  • so long as it’s a single post, it USED to be the case that you could still call those functions after The Loop, and they’d still be setup for the one post.

    that MAY have changed in the last release or two. In that case, yes, just build everything into an output variable (like $postmetaout = “In: “.get_the_category();) inside the loop, then just echo that outside whereever you want it.

    -d

    Wow…Think I should have tried that before posting, eh? 🙂

    Thanks for the reference though on the output variable, that will be useful for something else I’m working on.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Querying a post’s info in multiple locations within a page?’ is closed to new replies.