예제 #1
0
function custom_columns($column)
{
    global $post;
    if ($post->post_type == 'partner') {
        if ($column == 'featured_image') {
            echo the_post_thumbnail('thumbnail');
        } elseif ($column == 'content') {
            echo Utils\get_excerpt($post);
        } else {
            $custom = get_post_custom();
            if (array_key_exists($column, $custom)) {
                echo $custom[$column][0];
            }
        }
    }
}
예제 #2
0
<?php

use Firebelly\Utils;
$category = Utils\get_category($post);
$tags = Utils\get_tags($post);
$excerpt = Utils\get_excerpt($post, 30);
$type = get_post_type_object(get_post_type($post))->labels->singular_name;
?>
<article class="post-list-article">
  <?php 
if ($category) {
    ?>
    <a class="category" href="<?php 
    echo get_term_link($category);
    ?>
"><?php 
    echo $category->name;
    ?>
</a>
  <?php 
} else {
    ?>
    <a class="category" href="<?php 
    echo get_the_permalink($post);
    ?>
"><?php 
    echo $type;
    ?>
</a>
  <?php 
}