Come escludere un post dal loop di WordPress
Talvolta può essere necessario escludere dal loop dei post di WordPress alcuni articoli; possiamo semplicemente modificare come segue il loop php che di norma si trova nel file single.php
1 2 3 4 5 |
$my_query = new WP_Query(array ( 'post__not_in' => array(145 , 80 , 90), 'post_type' => 'post', 'posts_per_page' => '100' )); |
‘post__not_in’ => array(145 … Leggi tutto