当前位置: 首页>>代码示例>>PHP>>正文


PHP get_post_format_link函数代码示例

本文整理汇总了PHP中get_post_format_link函数的典型用法代码示例。如果您正苦于以下问题:PHP get_post_format_link函数的具体用法?PHP get_post_format_link怎么用?PHP get_post_format_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_post_format_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: twentysixteen_entry_meta

function twentysixteen_entry_meta()
{
    ob_start();
    if ('post' === get_post_type()) {
        ob_start();
        twentysixteen_entry_date();
        $postedOn = ob_get_clean();
        $author_avatar_size = apply_filters('twentysixteen_author_avatar_size', 49);
        printf('<div class="name-date"><div class="name"><span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></div><div class="date">%5$s</div></div><div class="avatar">%1$s</div>', get_avatar(get_the_author_meta('user_email'), $author_avatar_size), _x('Author', 'Used before post author name.', 'twentysixteen'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author(), $postedOn);
    }
    if (in_array(get_post_type(), array('attachment'))) {
        twentysixteen_entry_date();
    }
    $authordate = ob_get_clean();
    printf('<div class="author-date">%s</div>', $authordate);
    $format = get_post_format();
    if (current_theme_supports('post-formats', $format)) {
        printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', sprintf('<span class="screen-reader-text">%s </span>', _x('Format', 'Used before post format.', 'twentysixteen')), esc_url(get_post_format_link($format)), get_post_format_string($format));
    }
    echo '<div class="taxonomies">';
    if ('post' === get_post_type()) {
        twentysixteen_entry_taxonomies();
    }
    echo '</div>';
    if (!is_singular() && !post_password_required() && (comments_open() || get_comments_number())) {
        echo '<span class="comments-link">';
        comments_popup_link(sprintf(__('Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentysixteen'), get_the_title()));
        echo '</span>';
    }
}
开发者ID:GamingGroupAachen,项目名称:wp-template-ggac-2,代码行数:30,代码来源:functions.php

示例2: directory_theme_entry_meta

function directory_theme_entry_meta()
{
    if (is_sticky() && is_home() && !is_paged()) {
        printf('<span class="sticky-post">%s</span>', __('Featured', 'directory-starter'));
    }
    $format = get_post_format();
    if (current_theme_supports('post-formats', $format)) {
        printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', sprintf('<span class="screen-reader-text">%s </span>', _x('Format', 'Used before post format.', 'directory-starter')), esc_url(get_post_format_link($format)), get_post_format_string($format));
    }
    if (in_array(get_post_type(), array('post', 'attachment'))) {
        $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
        $time_string = sprintf($time_string, esc_attr(get_the_date('c')), get_the_date(), esc_attr(get_the_modified_date('c')), get_the_modified_date());
        printf('<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', _x('Posted on', 'Used before publish date.', 'directory-starter'), esc_url(get_permalink()), $time_string);
    }
    if ('post' == get_post_type()) {
        if (is_singular() || is_multi_author()) {
            printf('<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', _x('Author', 'Used before post author name.', 'directory-starter'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author());
        }
        $categories_list = get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'directory-starter'));
        if ($categories_list) {
            printf('<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Categories', 'Used before category names.', 'directory-starter'), $categories_list);
        }
        $tags_list = get_the_tag_list('', _x(', ', 'Used between list items, there is a space after the comma.', 'directory-starter'));
        if ($tags_list) {
            printf('<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Tags', 'Used before tag names.', 'directory-starter'), $tags_list);
        }
    }
    if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
        echo '<span class="comments-link">';
        comments_popup_link(__('Leave a comment', 'directory-starter'), __('1 Comment', 'directory-starter'), __('% Comments', 'directory-starter'));
        echo '</span>';
    }
}
开发者ID:mistergiri,项目名称:directory-starter,代码行数:33,代码来源:entrymeta.php

示例3: woo_tumblog_category_link

function woo_tumblog_category_link($post_id = 0, $type = 'articles')
{
    $category_link = '';
    if (get_option('woo_tumblog_content_method') == 'post_format') {
        $post_format = get_post_format();
        if ($post_format == '') {
            $category = get_the_category();
            $category_name = $category[0]->cat_name;
            // Get the ID of a given category
            $category_id = get_cat_ID($category_name);
            // Get the URL of this category
            $category_link = get_category_link($category_id);
        } else {
            $category_link = get_post_format_link($post_format);
        }
    } else {
        $tumblog_list = get_the_term_list($post_id, 'tumblog', '', '|', '');
        $tumblog_array = explode('|', $tumblog_list);
        ?>
		<?php 
        $tumblog_items = array('articles' => get_option('woo_articles_term_id'), 'images' => get_option('woo_images_term_id'), 'audio' => get_option('woo_audio_term_id'), 'video' => get_option('woo_video_term_id'), 'quotes' => get_option('woo_quotes_term_id'), 'links' => get_option('woo_links_term_id'));
        ?>
		<?php 
        // Get the ID of Tumblog Taxonomy
        $category_id = $tumblog_items[$type];
        $term =& get_term($category_id, 'tumblog');
        // Get the URL of Articles Tumblog Taxonomy
        $category_link = get_term_link($term, 'tumblog');
    }
    return $category_link;
}
开发者ID:niko-lgdcom,项目名称:archives,代码行数:31,代码来源:theme-tumblog.php

示例4: apostrophe_post_format

function apostrophe_post_format()
{
    $format = get_post_format();
    $formats = get_theme_support('post-formats');
    // If the post has no format, or if it's not a format supported by the theme, return early
    if (!$format || !has_post_format($formats[0])) {
        return;
    }
    printf('<a class="entry-format format-%1$s" href="%2$s" title="%3$s"><span class="screen-reader-text">%1$s</span></a>', esc_html(strtolower(get_post_format_string($format))), esc_url(get_post_format_link($format)), sprintf(esc_html('All %s posts', 'apostrophe'), esc_html(get_post_format_string($format))));
}
开发者ID:glugpace,项目名称:glugpace.org,代码行数:10,代码来源:template-tags.php

示例5: twentyfifteen_entry_meta

 /**
  * Prints HTML with meta information for the categories, tags.
  *
  * @since Twenty Fifteen 1.0
  */
 function twentyfifteen_entry_meta()
 {
     if (is_sticky() && is_home() && !is_paged()) {
         printf('<span class="sticky-post">%s</span>', __('Featured', 'twentyfifteen'));
     }
     $format = get_post_format();
     if (current_theme_supports('post-formats', $format)) {
         printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', sprintf('<span class="screen-reader-text">%s </span>', _x('Format', 'Used before post format.', 'twentyfifteen')), esc_url(get_post_format_link($format)), get_post_format_string($format));
     }
     if (in_array(get_post_type(), array('post', 'attachment'))) {
         $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
         if (get_the_time('U') !== get_the_modified_time('U')) {
             $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
         }
         $time_string = sprintf($time_string, esc_attr(get_the_date('D')), get_the_date(), esc_attr(get_the_modified_date('c')), get_the_modified_date());
         printf('<li class="icon fa-calendar posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></li>', _x('', 'Used before publish date.', 'twentyfifteen'), esc_url(get_permalink()), get_the_date('d/M'));
     }
     if ('post' == get_post_type()) {
         if (is_singular() || is_multi_author()) {
             // printf( '<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>',
             // 	_x( 'Author', 'Used before post author name.', 'twentyfifteen' ),
             // 	esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
             // 	get_the_author()
             // );
         }
         $categories_list = get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen'));
         if ($categories_list && twentyfifteen_categorized_blog()) {
             printf('<li class="cat-links icon fa fa-clone"><span class="screen-reader-text">%1$s </span>%2$s</li>', _x('Categories', 'Used before category names.', 'twentyfifteen'), $categories_list);
         }
         $tags_list = get_the_tag_list('', _x(', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen'));
         if ($tags_list) {
             printf('<li class="tags-links icon fa-tags"><span class="screen-reader-text">%1$s </span>%2$s</li>', _x('', 'Used before tag names.', 'twentyfifteen'), $tags_list);
         }
     }
     if (is_attachment() && wp_attachment_is_image()) {
         // Retrieve attachment metadata.
         $metadata = wp_get_attachment_metadata();
         printf('<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s &times; %4$s</a></span>', _x('Full size', 'Used before full size attachment link.', 'twentyfifteen'), esc_url(wp_get_attachment_url()), $metadata['width'], $metadata['height']);
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<li class="icon fa-comment">';
         /* translators: %s: post title */
         echo get_comments_number();
         echo '</li>';
         /* translators: %s: post title */
         // $categories = get_categories();
         // foreach ($categories as $key => $category) {
         // 	echo '<li class="icon fa-clone">';
         // 	echo $category->name;
         // 	echo '</li>';
         // }
     }
 }
开发者ID:durvalrafael,项目名称:durvalrafael,代码行数:58,代码来源:template-tags.php

示例6: wpsight_post_format_meta

function wpsight_post_format_meta($meta)
{
    if (!current_theme_supports('post-formats')) {
        return $meta;
    }
    // Get current post format
    $post_format = get_post_format();
    if (!empty($post_format)) {
        // Get post format link
        $post_format_link = get_post_format_link($post_format);
        // Return linked format icon with meta
        return '<a href="' . $post_format_link . '" class="post-format-link">' . wpsight_get_post_format_icon($post_format) . '</a>' . $meta;
    }
    return $meta;
}
开发者ID:phucanh92,项目名称:vietlong,代码行数:15,代码来源:post.php

示例7: widget

    function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
        $gallery = empty($instance['gallery']) ? ' ' : apply_filters('widget_gallery', $instance['gallery']);
        /**
         * Output the HTML for this widget.
         */
        echo $before_widget;
        if (!empty($title)) {
            echo $before_title . $title . $after_title;
        }
        echo '<div id="gallery-post-format-widget">';
        ?>

<?php 
        $custom = new WP_Query(array('order' => 'DESC', 'posts_per_page' => 1, 'no_found_rows' => true, 'post_status' => 'publish', 'post__not_in' => get_option('sticky_posts'), 'tax_query' => array(array('taxonomy' => 'post_format', 'terms' => array("post-format-gallery"), 'field' => 'slug', 'operator' => 'IN'))));
        if ($custom->have_posts()) {
            while ($custom->have_posts()) {
                $custom->the_post();
                $tmp_more = $GLOBALS['more'];
                $GLOBALS['more'] = 0;
                ?>



<?php 
                if (has_post_format('gallery')) {
                    the_content();
                }
                printf('<span class="entry-meta"><time class="entry-date" datetime="%2$s">%3$s</time></span>', esc_url(get_permalink()), esc_attr(get_the_date('c')), esc_html(get_the_date()));
                ?>


		<?php 
            }
        }
        // Reset the post globals as this query will have stomped on it.
        wp_reset_postdata();
        ?>


<?php 
        echo '<p><a href="' . get_post_format_link('gallery') . '" class="widget-format-link"><span class="screen-reader-text">' . $gallery . '</span></a></p>';
        echo '</div>';
        echo $after_widget;
    }
开发者ID:kimyj9501,项目名称:SingMyStory,代码行数:47,代码来源:format-gallery-widget.php

示例8: twentyfifteen_entry_meta

 /**
  * Prints HTML with meta information for the categories, tags.
  *
  * @since Twenty Fifteen 1.0
  */
 function twentyfifteen_entry_meta()
 {
     if (is_sticky() && is_home() && !is_paged()) {
         printf('<span class="sticky-post">%s</span>', __('Featured', 'twentyfifteen'));
     }
     $format = get_post_format();
     if (current_theme_supports('post-formats', $format)) {
         printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', sprintf('<span class="screen-reader-text">%s </span>', _x('Format', 'Used before post format.', 'twentyfifteen')), esc_url(get_post_format_link($format)), get_post_format_string($format));
     }
     if (in_array(get_post_type(), array('post', 'attachment'))) {
         $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
         if (get_the_time('U') !== get_the_modified_time('U')) {
             $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
         }
         $time_string = sprintf($time_string, esc_attr(get_the_date('c')), get_the_date(), esc_attr(get_the_modified_date('c')), get_the_modified_date());
         printf('<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', _x('Posted on', 'Used before publish date.', 'twentyfifteen'), esc_url(get_permalink()), $time_string);
     }
     if ('post' == get_post_type()) {
         if (is_singular() || is_multi_author()) {
             printf('<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', _x('Author', 'Used before post author name.', 'twentyfifteen'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author());
         }
         $categories_list = get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen'));
         if ($categories_list && twentyfifteen_categorized_blog()) {
             printf('<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Categories', 'Used before category names.', 'twentyfifteen'), $categories_list);
         }
         $tags_list = get_the_tag_list('', _x(', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen'));
         if ($tags_list) {
             printf('<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Tags', 'Used before tag names.', 'twentyfifteen'), $tags_list);
         }
     }
     if (is_attachment() && wp_attachment_is_image()) {
         // Retrieve attachment metadata.
         $metadata = wp_get_attachment_metadata();
         printf('<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s &times; %4$s</a></span>', _x('Full size', 'Used before full size attachment link.', 'twentyfifteen'), esc_url(wp_get_attachment_url()), $metadata['width'], $metadata['height']);
     }
     $_number_roman = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
     $_number_tibet = array('༠', '༡', '༢', '༣', '༤', '༥', '༦', '༧', '༨', '༩');
     $_number = get_comments_number();
     $new_number = str_replace($_number_roman, $_number_tibet, $_number);
     //echo $new_number;
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         comments_popup_link(__('Leave a comment', 'twentyfifteen'), __('1 Comment', 'twentyfifteen'), __('% Comments', 'twentyfifteen'));
         echo '</span>';
     }
 }
开发者ID:str33thack3r,项目名称:wp01,代码行数:51,代码来源:template-tags.php

示例9: twentysixteen_entry_meta

 function twentysixteen_entry_meta()
 {
     if (in_array(get_post_type(), array('post', 'attachment'))) {
         twentysixteen_entry_date();
     }
     $format = get_post_format();
     if (current_theme_supports('post-formats', $format)) {
         printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', sprintf('<span class="screen-reader-text">%s </span>', _x('Format', 'Used before post format.', 'twentysixteen')), esc_url(get_post_format_link($format)), get_post_format_string($format));
     }
     if ('post' === get_post_type()) {
         twentysixteen_entry_taxonomies();
     }
     if (!is_singular() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         comments_popup_link(sprintf(__('Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentysixteen'), get_the_title()));
         echo '</span>';
     }
 }
开发者ID:ashleah,项目名称:misty,代码行数:18,代码来源:functions.php

示例10: ubik_meta_type

function ubik_meta_type($link = true)
{
    // Exit early if we're not in the loop
    if (!in_the_loop()) {
        return;
    }
    // This sets a default type that can be overridden later
    $type = apply_filters('ubik_meta_type_default', __('Post', 'ubik'));
    // Content type
    if (is_attachment()) {
        if (wp_attachment_is_image()) {
            $type = __('Image', 'ubik');
        } else {
            $type = __('Attachment', 'ubik');
        }
    } elseif (is_page()) {
        $type = __('Page', 'ubik');
    }
    // Post format voodoo
    $post_format = get_post_format();
    if (!empty($post_format)) {
        $type = apply_filters('ubik_meta_post_format', get_post_format_string($post_format));
        if ($link === true) {
            $type = '<a href="' . esc_url(get_post_format_link($post_format)) . '">' . $type . '</a>';
        }
    }
    // Post type voodoo; get all post types that aren't built-in and cycle through to see if we have a match
    $post_types = get_post_types(array('public' => true, '_builtin' => false), 'objects');
    if (!empty($post_types)) {
        foreach ($post_types as $post_type) {
            if ($post_type->name === get_post_type()) {
                if ($post_type->has_archive && $link === true) {
                    $type = sprintf('<a href="%1$s">%2$s</a>', esc_url(get_post_type_archive_link($post_type->name)), $post_type->labels->singular_name);
                } else {
                    $type = $post_type->labels->singular_name;
                }
            }
        }
    }
    // Return whatever we have found
    return apply_filters('ubik_meta_type', $type);
}
开发者ID:synapticism,项目名称:ubik-meta,代码行数:42,代码来源:ubik-meta-various.php

示例11: launchpad_entry_meta

 /**
  * Prints HTML with meta information for the categories, tags.
  *
  * @since Twenty Fifteen 1.0
  */
 function launchpad_entry_meta()
 {
     if (is_sticky() && is_home() && !is_paged()) {
         printf('<span class="sticky-post">%s</span>', __('Featured', 'lifterlms-launchpad'));
     }
     $format = get_post_format();
     if (current_theme_supports('post-formats', $format)) {
         printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', sprintf('<span class="meta-label">%s </span>', _x('Format', 'Used before post format.', 'lifterlmns-launchpad')), esc_url(get_post_format_link($format)), get_post_format_string($format));
     }
     if (in_array(get_post_type(), array('post', 'attachment'))) {
         $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
         // if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
         //     $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
         // }
         $time_string = sprintf($time_string, esc_attr(get_the_date('c')), get_the_date(), esc_attr(get_the_modified_date('c')), get_the_modified_date());
         printf('<span class="posted-on"><span class="meta-label">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', _x('Posted on', 'Used before publish date.', 'lifterlms-launchpad'), esc_url(get_permalink()), $time_string);
     }
     if ('post' == get_post_type()) {
         if (is_singular() || is_multi_author()) {
             printf('<span class="byline"><span class="author vcard"><span class="meta-label">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', _x('Author', 'Used before post author name.', 'lifterlms-launchpad'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author());
         }
         $categories_list = get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'lifterlms-launchpad'));
         if ($categories_list && launchpad_categorized_blog()) {
             printf('<span class="cat-links"><span class="meta-label">%1$s </span>%2$s</span>', _x('Categories', 'Used before category names.', 'lifterlms-launchpad'), $categories_list);
         }
         $tags_list = get_the_tag_list('', _x(', ', 'Used between list items, there is a space after the comma.', 'lifterlms-launchpad'));
         if ($tags_list) {
             printf('<span class="tags-links"><span class="meta-label">%1$s </span>%2$s</span>', _x('Tags', 'Used before tag names.', 'lifterlms-launchpad'), $tags_list);
         }
     }
     if (is_attachment() && wp_attachment_is_image()) {
         // Retrieve attachment metadata.
         $metadata = wp_get_attachment_metadata();
         printf('<span class="full-size-link"><span class="meta-label">%1$s </span><a href="%2$s">%3$s &times; %4$s</a></span>', _x('Full size', 'Used before full size attachment link.', 'lifterlms-launchpad'), esc_url(wp_get_attachment_url()), $metadata['width'], $metadata['height']);
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         /* translators: %s: post title */
         comments_popup_link(sprintf(__('Leave a comment<span class="meta-label"> on %s</span>', 'lifterlms-launchpad'), get_the_title()));
         echo '</span>';
     }
 }
开发者ID:gocodebox,项目名称:launchpad-framework,代码行数:47,代码来源:helpers.php

示例12: wp_futurelab_entry_meta

 /**
  * Prints HTML with meta information for the categories, tags.
  *
  * Create your own wp_futurelab_entry_meta() function to override in a child theme.
  *
  */
 function wp_futurelab_entry_meta()
 {
     if ('post' === get_post_type()) {
         $author_avatar_size = apply_filters('wp_futurelab_author_avatar_size', 49);
         printf('<span class="byline"><span class="author vcard">%1$s<span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></span></span>', get_avatar(get_the_author_meta('user_email'), $author_avatar_size), _x('Author', 'Used before post author name.', 'wp_futurelab'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author());
     }
     if (in_array(get_post_type(), array('post', 'attachment'))) {
         wp_futurelab_entry_date();
     }
     $format = get_post_format();
     if (current_theme_supports('post-formats', $format)) {
         printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', sprintf('<span class="screen-reader-text">%s </span>', _x('Format', 'Used before post format.', 'wp_futurelab')), esc_url(get_post_format_link($format)), get_post_format_string($format));
     }
     if ('post' === get_post_type()) {
         wp_futurelab_entry_taxonomies();
     }
     if (!is_singular() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         comments_popup_link(sprintf(__('Leave a comment<span class="screen-reader-text"> on %s</span>', 'wp_futurelab'), get_the_title()));
         echo '</span>';
     }
 }
开发者ID:futurelabnz,项目名称:wp-futurelab,代码行数:28,代码来源:template-tags.php

示例13: twentyfifteen_child_entry_meta

function twentyfifteen_child_entry_meta()
{
    if (is_sticky() && is_home() && !is_paged()) {
        printf('<span class="sticky-post">%s</span>', __('Featured', 'twentyfifteen'));
    }
    $format = get_post_format();
    if (current_theme_supports('post-formats', $format)) {
        printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', sprintf('<span class="screen-reader-text">%s </span>', _x('Format', 'Used before post format.', 'twentyfifteen')), esc_url(get_post_format_link($format)), get_post_format_string($format));
    }
    if (in_array(get_post_type(), array('post', 'attachment'))) {
        $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
        if (get_the_time('U') !== get_the_modified_time('U')) {
            $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
        }
        $time_string = sprintf($time_string, esc_attr(get_the_date('c')), get_the_date(), esc_attr(get_the_modified_date('c')), get_the_modified_date());
        printf('<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', _x('Posted on', 'Used before publish date.', 'twentyfifteen'), esc_url(get_permalink()), $time_string);
    }
    if ('post' == get_post_type()) {
        if (is_singular() || is_multi_author()) {
            printf('<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', _x('Author', 'Used before post author name.', 'twentyfifteen'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author());
        }
    }
}
开发者ID:JackDougherty,项目名称:twentyfifteen-child-theme,代码行数:23,代码来源:functions.php

示例14: vanillamilkshake_entry_meta

 /**
  * Prints HTML with meta information for the categories, tags.
  */
 function vanillamilkshake_entry_meta()
 {
     if (is_sticky() && is_home() && !is_paged()) {
         printf('<span class="sticky-post">%s</span>', __('Featured', 'vanillamilkshake'));
     }
     $format = get_post_format();
     if (current_theme_supports('post-formats', $format)) {
         printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', sprintf('<span class="screen-reader-text">%s </span>', _x('Format', 'Used before post format.', 'vanillamilkshake')), esc_url(get_post_format_link($format)), get_post_format_string($format));
     }
     if ('post' == get_post_type()) {
         if (is_singular() || is_multi_author()) {
             printf('<div class="byline marginbottom-medium"><span class="author vcard"><span class="screen-reader-text">%1$s </span><span class="light-gray">&#9670;</span> <a class="url fn n" href="%2$s">%3$s</a></span></div>', _x('Author', 'Used before post author name.', 'vanillamilkshake'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author());
         }
         /* divider between author & categories/tags */
         printf('<div class="marginvertical-medium height-000625 backgroundcolor-light-gray"></div>');
         $categories_list = get_the_category_list(' <span class="light-gray">&#9656;</span> ');
         if ($categories_list && vanillamilkshake_categorized_blog()) {
             printf('<span class="cat-links xsmall"><span class="screen-reader-text">%1$s </span><span class="light-gray"> &#9656;</span> %2$s</span>', _x('Categories', 'Used before category names.', 'vanillamilkshake'), $categories_list);
         }
         $tags_list = get_the_tag_list('', ' <span class="light-gray">&#9656;</span> ');
         if ($tags_list) {
             printf('<span class="tags-links xsmall"><span class="screen-reader-text">%1$s </span><span class="light-gray"> &#9656;</span> %2$s</span>', _x('Tags', 'Used before tag names.', 'vanillamilkshake'), $tags_list);
         }
     }
     if (is_attachment() && wp_attachment_is_image()) {
         // Retrieve attachment metadata.
         $metadata = wp_get_attachment_metadata();
         printf('<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s &times; %4$s</a></span>', _x('Full size', 'Used before full size attachment link.', 'vanillamilkshake'), esc_url(wp_get_attachment_url()), $metadata['width'], $metadata['height']);
     }
     /*
     	if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
     		echo '<div class="comments-link">';
     		comments_popup_link( __( 'Leave a comment', 'vanillamilkshake' ), __( '1 Comment', 'vanillamilkshake' ), __( '% Comments', 'vanillamilkshake' ) );
     		echo '</div>';
     	}*/
 }
开发者ID:jikoyster,项目名称:test-wp,代码行数:39,代码来源:template-tags.php

示例15: the_permalink

	<div class="entry-container post-format">
    
        <header class="entry-header">
            <h1 class="entry-title"><a href="<?php 
the_permalink();
?>
" title="<?php 
echo esc_attr(sprintf(__('Permalink to %s', 'catch-kathmandu'), the_title_attribute('echo=0')));
?>
" rel="bookmark"><?php 
the_title();
?>
</a></h1>
            <h2 class="entry-format"><a href="<?php 
echo get_post_format_link('Image');
?>
" title="<?php 
_e('All Image Posts', 'catch-kathmandu');
?>
"><?php 
_e('Image', 'catch-kathmandu');
?>
</a></h2>
        </header><!-- .entry-header -->  
    	
		<?php 
if (is_search()) {
    // Only display Excerpts for Search
    ?>
            <div class="entry-summary">
开发者ID:jaironman3008,项目名称:rctgrigota2015,代码行数:30,代码来源:content-image.php


注:本文中的get_post_format_link函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。