0

I want to remove one post from a post feed in WordPress with CSS (screenshot attached)! The feed is made with custom fields! It is important to remove it with CSS as the posts will still be used in a different translation of the site!

function fb_exclude_filter($query) {
    if ( !$query->is_admin && $query->is_feed) {
        $query->set('post__not_in', array(40, 9) ); // id of page or post
    }
    return $query;
}
add_filter( 'pre_get_posts', 'fb_exclude_filter' );

But it doesn't work!

Any help?

enter image description here

cabrerahector
  • 3,653
  • 4
  • 16
  • 27
  • 2
    Welcome to Stack Overflow! 1. `pre_get_posts` is an `action` not a `filter`. 2. That's not CSS, that's PHP. 3. You could easily check the language and remove the post if it is a specific language. What is the actual post id you want to remove from the query? What are you using for the translation management? – disinfor Oct 16 '20 at 16:11

1 Answers1

0

Right click on the post and search in the dev-tool for its class or its parents class. Then you are able to say display: none;

Undelivered
  • 45
  • 1
  • 7
  • Thanks for your recommendation, I already did that, but the same class is applied to all of the posts from that feed and it removes all of them! – Daniel Croitor Oct 18 '20 at 05:36