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.
Articles Tagged 'query_posts ()'
Very short trick: WordPress, reset a query
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".
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:






Latest Comments
Mark : @ Mark: Thanks for the answer. For example, if you have a code to save / use the folder ...
Mark : Thanks for the answer. For example, if you have a code to save / use the folder ...
Giovambattista Fazioli : @ Mark: in principle, absolutely, a lot depends on how and what to download. La. ..
Mark : Hello, good guide! I wanted to ask, you can use the same code to run a sql database? Instead of ...
Joseph : Hi I wanted to ask you how you can do in the post I uploaded a gallery of 50 images, for example, ...