WordPress.org

Ready to get started?Download WordPress

Forums

making meta data available from all posts...? (1 post)

  1. darrellberry
    Member
    Posted 9 years ago #

    in http://wiki.wordpress.org/PostMeta, it is stated that "The values from this table [$tablepostmeta] are pulled into a structured multi-dimensional array called $post_meta_cache, just after the $posts array is fetched in wp-blog-header.php. This variable will only contain values for the list of posts fetched for the current page build. ".

    This is all cool, unless you are doing what i'm doing: I have two sidebars generated from kitten's show_category_posts plugin, and with those, I want to have some conditional code based on the values of custom data fields -- the problem is that the $post_meta_cache doesn't have any information in it for the post ids in the sidebars unless those posts also appear in the 'main' part of the page, given the above.

    So, what's the tidiest way to get seomthing like $post_meta_cache populated with ALL posts' metadata? Is there any better way than embedding a sql query in my page?

    thx

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.