php - Wordpress exclude category from blog in twenty twelve template -


I googling around without having to use a plugin, how to exclude a category from my blog I

I came up with this:

  & lt ;? Php query_posts ('cat = -2'); ? & Gt; & Lt ;? Php while (is_pause ()): the_post (); ? & Gt; & Lt ;? php get_template_part ('content', 'page'); ? & Gt; & Lt ;? Php // comments_template ('', is true); ? & Gt; & Lt ;? php timeline; // the end of the loop? & Gt;   

But this does not remove blog posting with the category id of 2. Why can this be clarified?

Try this:

  query_posts ($ query_string. '& Amp; ; Cat = -2 ');    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -