Query posts with meta values

Posted in: Newspaper
Post count: 6

Hey everybody,
first of all I only did a brief search on the forums to see if this was already asked since I am quite under time pressure on this project. If so please forgive me and just link me to the topic.
I need to create different pages that show only posts with a certain meta key – meta value combination.
Is this in some way possible with the existing templates or do I need to create new ones with extra options for this purpose?
I could also see this realized with custom fields on page creation but would need to know where to check for these values then.

Example:
A ‘popular’ page should only show post with
meta_key => ‘_status’,
meta_value => 2

Any help would be much appreciated!!
Oh and very nice work with the theme guys 😉
Best,
J

Post count: 6

Update:
I tried to solve this using tags, so I created a popular tag to filter the posts that way. I put the tag slug in the ‘Filter by tag slug:’ field and updated the page.
However when I tried to view the page to see if it worked, it loaded forever and only just in time I could restart my apache and mysql it as it was nearly getting my server down, my other sites were already unreachable.
Any ideas what happened there?
Best,
J

Post count: 6

I solved this for now. I am using categories for the different pages as a solution. If anybody comes up with how to use meta it would still be interesting though 😉

Post count: 780

Hi,

tags should have worked, I’ve tested the filter and it works as expected. It may be that you either have a lot of content or the database configuration is not good.

This is the function that renders our loops on the templates http://screencast.com/t/flqgW87f . The functions above that is used by the blocks.

Sorry for the delay,
Radu O.

Post count: 6

Hi Radu,
no problem with the delay as it is working with the categories just fine. It may actually be the amount of content, since we have quite a large database.
Thank you for the reply anyways!
Best,
J

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.