Email: info@wpitaly.it
Ho risolto da me (: a qualcuno potrebbe servire, lo posto:
<?php
//exclude these from displaying
$exclude = array(“NOME CATEGORIA”);
//set up an empty categorystring
$catagorystrings = array();
//loop through the categories for this post
foreach((get_the_category()) as $category)
{
//if not in the exclude array
if (!in_array($category->cat_name, $exclude))
{
$catagorystrings[] = ‘-a href=”‘.get_bloginfo(url).get_option(‘category_base’).’/category/’.$category->slug.'”-‘.$category->name.’-/a-‘;
}
}
echo join(‘, ‘,$catagorystrings);
?>
N.B. ho messo dei trattiti al posto delle parentesi per non far parsare il tag < a >
Allora ho seguito l’ultimo codice per rendere la categoria cliccabile. Mi servirebbe però un consiglio: mettendo un separatore (una virgola) dopo $categoryx->cat_name (dunque $categoryx->cat_name,) il separatore viene visualizzato anche dopo l’ultima categoria elencata. Vorrei che l’ultimo separatore non venisse visualizzato appunto. Sapete come si può fare?
WPItaly - Copyright Creative Commons: CC BY-NC-SA 4.0