Get-Category-format
-
Hello everybody,
I have this website (http://www.sergisirvent.miraquewebs.com/) and with this code, in the home page, it appear a box for every post:
<?php
$format = get_post_format();
get_template_part( “formats/”.$format );if($format == “”)
get_template_part( “formats/standard” );?>
I wanna make the same but for each category, I tried different ways (with if… for each post) but nothing worked. The only useful I got is this that if I put it in the loop it print the category names:
$output .= ‘<div class=”post” style=”position: absolute; left: 0px; top: 0px; transform: translate3d(0px, 0px, 0px); opacity: 1; width: 270px;”>term_id ).'” title=”‘ . esc_attr( sprintf( __( “View all posts in %s” ), $category->name ) ) . ‘”>’.$category->cat_name.’</div>’.$separator;
echo trim($output, $separator);Thanks a lot for your help,
Javi
The topic ‘Get-Category-format’ is closed to new replies.