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.

  • 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 clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.