Combo-Menü Kategorien in WordPress 2.5.1

So erstellen Sie ein Menü / Combo (tag select ) ohne Submit-Button und kann in die Kategorie aktuell angezeigten bewegen, können Sie den folgenden Code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14

"" > Seleziona una categoria < / option > < Option value = ""> Kategorie auswählen </ Option >
<Php
? ( single_cat_title ( '' , false ) ) : "" ) ; $ Foo = ((is_category ()) (Single_cat_title ('', false)): "");
) ; $option = '' ; $ Get_categories Kategorien = ('orderby = name & hierarchischen = 0'), $ options ='';
foreach ($ categories als $ cat) {
$cat-> cat_name == $foo)?"selected":"" ).' $ Option = ". <option'. (($ Foo == $cat-> cat_name)" Selected ":" ")." value = "/ category / '. $ cat-> category_nicename .'">';
$ Options .= $ cat-> cat_name;
$ Options .= '('. $ Cat-> category_count .')';
'; $ Options .= '</ Option > ';
}
echo $ option;
?>
</ wählen >

, permette di eliminare un eventuale bottone di submit. Die Veranstaltung onchange , in den Tag select , werden sämtliche Submit-Button. Die Funktion WordPress is_category() , aber bestimmt, ob wir Ihnen präsentieren, eine "store" Kategorien, um den Titel / Namen der angezeigten Kategorie zu erhalten.

Es gibt keine Kommentare für diesen Beitrag

Hinterlasse einen Kommentar

XHTML TAG PERMIT: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> INSERTION CODE:
 <pre></pre> // blocco generico <code></code> // blocco generico [cc_actionscript][/cc_actionscript] // Actionscript [cc_actionscript3][/cc_actionscript3] // Actionscript 3 [cc_css][/cc_css] // CSS Style Sheet [cc_html][/cc_html] // HTML [cc_js][/cc_js] // Javascript [cc_objc][/cc_objc] // Objective-C [cc_php][/cc_objc] // PHP [cc_sql][/cc_sql] // SQL 


Stoppen SOPA