latest articles home page

Latest Reply from sil_vav at 2014-09-25 08:38:21 Solution
I set as the home page the latest articles of my blog. But on the home page I would like to see only certain articles of a category. how can I do this?
Hi!
To fix this you have to replace the code:
	query_posts($query_string);

with:
if (is_home()) {
query_posts($query_string.'&cat=YOURCATEGORY_ID&p=YOURPOST_ID&etc');
}
else {
query_posts($query_string);
}

in the file theloop.php.
Sorry, I've created a new category for the items you would like to have in my home. Category is called ULTIMI ARTICOLI. Ho fatto come mi avete detto, nel file theloop ho scritto questo codice, but it does not work. Can you tell me where I'm wrong? :)

if (is_home()) {
query_posts($query_string.'&cat=ULTIMI ARTICOLI');
}
else {
query_posts($query_string);
}
Ok..I had written the name of the class, instead I had to write the ID!! now it works! Thanks :)

Leave a reply

Add codeAdd image