“Obtenha o nome da categoria por id wordpress” Respostas de código

Exibir nome da categoria WordPress

<?php
$categories = get_the_category();
if ( ! empty( $categories ) ) {
	echo '<a href="' . esc_url( get_category_link( $categories[0]->term_id ) ) . '">' . esc_html( $categories[0]->name ) . '</a>';
}
?>
heinthuya

Obtenha o nome da categoria por id wordpress

get_cat_name( $cat_id );
Vivacious Vulture

Obtenha postagens do WordPress por nome da categoria ..!

<?php query_posts('category_name=CATEGORYNAME&showposts=5');

while (have_posts()) : the_post(); ?>

the_title();   // To display the title of all posts that have category name selected 

the_content();   // To display the content of all posts that have category name selected 


<?php endwhile; ?>
Loreto

Respostas semelhantes a “Obtenha o nome da categoria por id wordpress”

Perguntas semelhantes a “Obtenha o nome da categoria por id wordpress”

Mais respostas relacionadas para “Obtenha o nome da categoria por id wordpress” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código