Support

Account

Forum Replies Created

  • You should use php’s usort. The code below:

    1. creates a function that grabs the featured post’s ID (set in a custom field assigned to the posts page)
    2. checks posts in the query and compares two at a time, moving $post_a to the front if its ID matches the featured post ID.

    usort( $wp_query->posts, function ( $post_a, $post_b ) {
        
        $featured = get_field('featured_post', $page)[0];
    
        $a = $post_a->ID == $featured;
        $b = $post_b->ID == $featured;
    
        if ( !$a && !$b ) { // both false
            return 0;
        }
        return ( $a ) ? - 1 : 1;
    } );
    
  • There’s nothing I’ve tried that’s been terribly promising that you haven’t already done. I tried deactivating and re-activating the acf plugin (on my local site), but that didn’t do much…

  • We’re seeing the same issue. Using ACF Pro version 5.9.7, wordpress 5.7.2 – but saw the problem before updating the acf plugin, when it was 5.9.5.

Viewing 3 posts - 1 through 3 (of 3 total)