SHARE
TWEET

Menyembunyikan Post di Acrhive

pustakakoran Aug 22nd, 2019 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function my_custom_get_posts( $query ) {
  2.     if ( is_admin() || ! $query->is_main_query() )
  3.         return;
  4.  
  5.     if ( $query->is_archive() ) {
  6.         $query->set( 'post__not_in', array( 7, 11, 21 ) );
  7.     }
  8. }
  9. add_action( 'pre_get_posts', 'my_custom_get_posts', 1 );
  10.  
  11. angka 7, 11, 21 adalah ID Post yang mau disembunyikan
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top