• May 31, 2017

    Sometimes, when you display certain posts on your WordPress powered site you may need to hide speciffic categories from posts pages. This is needed because categories are often used as system “markers” in site’s structure.

    To do this, enter the following lines above the Loop (check out this tutorial for more information on What is The Loop)

    <?php if (is_front_page() && !is_paged() 
    ) $posts = query_posts($query_string . '&cat=-33,-66'); ?>

    This prevents posts from categories 33 and 66 from appearing in the list of posts.



เวอไนน์ไอคอร์ส

ประหยัดเวลากว่า 100 เท่า!






เวอไนน์เว็บไซต์⚡️
สร้างเว็บไซต์ ดูแลเว็บไซต์

Categories