Elencare tutti i tag di un tipo di post personalizzato
25 lug 2012, 10:53:10
Visualizzazioni: 30.9K
Voti: 9
Sto cercando una soluzione per visualizzare tutti i tag che vengono utilizzati in un tipo di post personalizzato (custom post type). Voglio semplicemente elencarli tutti perché intendo aggiungere del codice jQuery su ciascun tag. :)

markyeoj
507
Commenti
Tutte le risposte alla domanda
2
1
wp_get_object_terms ti fornirà la risposta che cerchi.
wp_get_object_terms( $post_ids, 'post_tag', $optional_args );
Esiste anche get_the_terms che è più semplice ma svolge comunque il lavoro.
get_the_terms( $id, 'post_tag');

Cristian
1.38K
25 lug 2012 11:48:48
0
Sia the_tags()
che the_terms()
utilizzano get_the_term_list()
, la differenza è che the_tags()
ha già preimpostato post_tag
come valore predefinito.
Puoi trovarle nel file wp-includes/category-template.php

Keshav Infotech
41
19 gen 2016 09:58:15
Domande correlate
2
risposte
1
risposte
2
risposte