Archive for January, 2009


I hate Israel?


I hate Israel

cause i cant accept killing angel, israel do kill the children and i think they are just some angel who dont know why they have been killed, I think the fucken looser Israel making the wrong thing killing children,

If you anyone dare to say you accept killing children like this… Continue reading

Few wOrDpReSs tips


Template Tags/query posts

if (window.showTocToggle) { var tocShowText = “show”; var tocHideText = “hide”; showTocToggle(); }

Description

Query_posts can be used to control which posts show up in The Loop. It accepts a variety of parameters in the same format as used in your URL (e.g. p=4 to show only post of ID number 4).

Why go through all the trouble of changing the query that was meticulously created from your given URL? You can customize the presentation of your blog entries by combining it with page logic (like the Conditional Tags) — all without changing any of the URLs.

Common uses might be to:

  • Display only a single post on your homepage (a single Page can be done via Settings -> Reading).
  • Show all posts from a particular time period.
  • Show the latest post (only) on the front page.
  • Change how posts are ordered.
  • Show posts from only one category.
  • Exclude one or more categories.

Important note

The query_posts function is intended to be used to modify the main page Loop only. It is not intended as a means to create secondary Loops on the page. If you want to create separate Loops outside of the main one, you should create separate WP_Query objects and use those instead. Use of query_posts on Loops other than the main one can result in your main Loop becoming incorrect and possibly displaying things that you were not expecting.

The query_posts function overrides and replaces the main query for the page. To save your sanity, do not use it for any other purpose.

Usage

Place a call to query_posts() in one of your Template files before The Loop begins. The wp_query object will generate a new SQL query using your parameters. When you do this, WordPress ignores the other parameters it receives via the URL (such as page number or category). If you want to preserve that information, you can use the variable $query_string in the call to query_posts().

For example, to set the display order of the posts without affecting the rest of the query string, you could place the following before The Loop:

query_posts($query_string . "&order=ASC")

When using query_posts in this way, the quoted portion of the argument must begin with an ampersand (&).

Continue reading