WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering if anyone can help. I'm using the advanced custom fields plugin and I'm trying to find the first occurrence of a custom field by date, so really the newest post which has a custom field set to true.

The field I'm looking for is

field type: true/false field name: featured_post

I want to exclude this post from the homepage so I'm trying to edit the globe query in functions.php

function filter_posts_blog_page() {
    // $firstfeatured
    // excluded the $firstfeatured 
add_filter('pre_get_posts', 'filter_posts_blog_page');

Sorry, I do not know much php but any help would be great.

share|improve this question
Which theme are you using? How are the posts on your homepage currently displayed? Are you using a custom loop or the default WordPress loop? How are the homepage posts currently sorted? – cfx Feb 22 '14 at 20:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.