mitchrenton
Member
Posted 2 years ago #
Hi Guys,
Just wondering if anybody can help me here. I want to create a loop that returns all pages with a specific custom field. Can this be done? I have no problem returning pages with specific custom fields but having trouble returning pages.
Has anybody achieved this?
mitchrenton
Member
Posted 2 years ago #
Oops just realised a typo, should have read...
Hi Guys,
Just wondering if anybody can help me here. I want to create a loop that returns all pages with a specific custom field. Can this be done? I have no problem returning *posts* with specific custom fields but having trouble returning pages.
Has anybody achieved this?
Custom Fields explains and gives examples
mitchrenton
Member
Posted 2 years ago #
I've managed to solve this one, incase anybody else runs into it...
You have to tell the loop that you want to look at pages and not posts by using the following...
<?php query_posts(array('post_type' => 'page'); ?>
You don't necessarily need the array...
Just..
<?php query_posts('post_type=page'); ?>
..should be fine..
:)