Return to post a specific category.
-
Bem gente, o negócio é o próximo. Estou criando um widget para a barra lateral. Este elemento tem de reconhecer que a categoria é no momento, e de lá selecionar a subcategoria com o nome de colunistas e exibir 5 publicações desta subcategoria.
Hierarquia do Jornal on-line
2013 -> Edição 175 -> Colunistas (mensagens que estão na categoria colunista)
. Meu código está procurando a bala e não o nome da categoria
O problema é que a mudança lesma de acordo com suas categorias pai (EX: clunista-edicao175) então eu não posso usá-lo.<? Php $ Category = get_the_category (); $ CatParID = $ categoria [0] -> category_parent; $ CatParent = get_cat_name $ (catParID); $ MINHACONSULTA = new WP_Query ('cat =' $ catParID 'e category_name = Colunistas & posts_per_page = 5'..); if ($ MINHACONSULTA-> have_posts ()): while ($ MINHACONSULTA-> have_posts ()):? $ MINHACONSULTA-> the_post ();> <Aaa hreeeeeef = rel = título de "bookmark" = "<php the_title ()?;>" "<Php the_permaliiiiink ()>?"> <Php the_title ();?> ? <Php endwhile; endif; wp_reset_query ();?>
[Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Return to post a specific category.’ is closed to new replies.