Пример #1
0
/**
 * POST META
 *
 * output post meta data, based on arguments
 * @since 7.0
 */
function bizz_post_meta($args = '')
{
    $args = isset($args[0]) ? $args[0] : $args;
    #[0] array level
    $show_meta = is_singular() && !is_singular('post') ? isset($args['post_meta']) && $args['post_meta'] ? true : false : true;
    $return_meta = '';
    if ($show_meta) {
        $return_meta .= "<" . apply_filters('bizz_html5_aside', "p") . " class=\"headline_meta\">";
        if ($args['post_date']) {
            $return_meta .= '<span class="date"><abbr class="published" title="' . get_the_time('Y-m-d') . '">' . get_the_time(get_option('date_format')) . '</abbr></span>';
        }
        if ($args['post_author']) {
            $return_meta .= '<span class="auth"><a href="' . get_author_posts_url(get_the_author_meta('ID')) . '" class="auth" rel="nofollow">' . get_the_author() . '</a></span>';
        }
        if ($args['post_comments']) {
            $return_meta .= '<span class="comm">';
            $num_comments = get_comments_number();
            // get_comments_number returns only a numeric value
            if (comments_open()) {
                if ($num_comments == 0) {
                    $comments = __('No Comments', 'bizzthemes');
                } elseif ($num_comments > 1) {
                    $comments = sprintf(__('%d Comments', 'bizzthemes'), $num_comments);
                } else {
                    $comments = __('One Comment', 'bizzthemes');
                }
                $return_meta .= '<a href="' . get_comments_link() . '" rel="nofollow">' . $comments . '</a>';
            } else {
                $return_meta .= __('Comments are closed.', 'bizzthemes');
            }
            $return_meta .= '</span>';
        }
        if ($args['post_categories']) {
            $return_meta .= seo_post_cats();
        }
        if ($args['post_tags']) {
            $return_meta .= seo_post_tags();
        }
        if ($args['post_edit']) {
            if (current_user_can('manage_options') && is_user_logged_in()) {
                $return_meta .= '<span class="edit">' . get_edit_post_link() . '</span>';
            }
        }
        $return_meta .= "</" . apply_filters('bizz_html5_aside', "p") . ">\n";
    }
    echo apply_filters('bizz_post_meta', $return_meta, $show_meta, $args);
}
Пример #2
0
function responsive_post_meta_loop($args)
{
    global $post;
    if (isset($args[0])) {
        $args = $args[0];
    }
    #[0] array level
    $post_type = get_post_type($post);
    if ($post_type == 'post') {
        echo "<aside class=\"headline_meta\">";
        if ($args['post_author']) {
            echo '<span class="auth"><a href="' . get_author_posts_url(get_the_author_meta('ID')) . '" class="auth" rel="nofollow">' . get_the_author() . '</a></span>';
        }
        if ($args['post_comments']) {
            echo '<span class="comm"><a href="' . get_permalink() . '#comments" rel="nofollow">';
            $num_comments = get_comments_number();
            // get_comments_number returns only a numeric value
            if (comments_open()) {
                if ($num_comments == 0) {
                    $comments = __('No Comments', 'bizzthemes');
                } elseif ($num_comments > 1) {
                    $comments = sprintf(__('%d Comments', 'bizzthemes'), $num_comments);
                } else {
                    $comments = __('One Comment', 'bizzthemes');
                }
                echo '<a href="' . get_comments_link() . '">' . $comments . '</a>';
            } else {
                echo __('Comments are closed.', 'bizzthemes');
            }
            echo '</a></span>';
        }
        if ($args['post_categories']) {
            echo seo_post_cats();
        }
        if ($args['post_tags']) {
            echo seo_post_tags();
        }
        if ($args['post_edit']) {
            if (current_user_can('manage_options') && is_user_logged_in()) {
                edit_post_link(__('Edit', 'bizzthemes'), '<span class="edit">', '</span>');
            }
        }
        echo "</aside>\n";
    }
}