Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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() {
    if(is_home())
    {
    // $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 at 20:47

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.