Articles Tagged 'query_posts ()'

Very short trick: WordPress, reset a query

I often happen to customize the home page ( index.php ), or other sections such as the Sidebar, a Web site made ​​with WordPress. Many of the customizations affect loop with specific parameters, for example in order to view the last items of a specific category or tag.

Continued ...

WordPress: Remove duplicate posts in multiple loops

(che poi sono fondamentalmente la stessa cosa) di WordPress permette di ottenere una lista di post impostando numerosi parametri di ricerca (vedi Very short snippet: visualizzare una lista di post per categoria o tag ). The useful feature query_posts() or object WP_Query (which are basically the same thing) WordPress allows you to get a list of many post-setting search parameters (see Very short snippet: Display a list of posts by category or tags ). Precisely because of its versatility in search of post may happen that the function using two or more times in a row you get the "duplicate".

Continued ...

Very short snippet: Display a list of posts by category or tags

Two useful features, customizable at will, to be used to show the last n posts of a category or one or more tags. Functions, as you will see, are very similar and are both based on a loop generated by query_post() . The first, show_title_cat() , shows the last post (in this version only the title) of a specific category:

Continued ...