/** * Prints HTML with meta information for the current post-date/time, author, comment count and categories. */ function ultra_posted_on() { echo '<div class="entry-meta-inner">'; if (is_sticky() && is_home() && !is_paged()) { echo '<span class="featured-post">' . __('Sticky', 'ultra') . '</span>'; } if (is_home() && siteorigin_setting('blog_post_date') || is_archive() && siteorigin_setting('blog_post_date') || is_search() && siteorigin_setting('blog_post_date')) { echo '<span class="entry-date"><a href="' . esc_url(get_permalink()) . '" rel="bookmark"><time class="published" datetime="' . esc_attr(get_the_date('c')) . '">' . esc_html(get_the_date('j F Y')) . '</time><time class="updated" datetime="' . esc_attr(get_the_modified_date('c')) . '">' . esc_html(get_the_modified_date()) . '</time></span></a>'; } if (is_single() && siteorigin_setting('blog_post_date')) { echo '<span class="entry-date"><time class="published" datetime="' . esc_attr(get_the_date('c')) . '">' . esc_html(get_the_date('j F Y')) . '</time><time class="updated" datetime="' . esc_attr(get_the_modified_date('c')) . '">' . esc_html(get_the_modified_date()) . '</time></span>'; } if (siteorigin_setting('blog_post_author')) { echo '<span class="byline"><span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '" rel="author">' . esc_html(get_the_author()) . '</a></span></span>'; } if (comments_open() && siteorigin_setting('blog_post_comment_count')) { echo '<span class="comments-link">'; comments_popup_link(__('Leave a comment', 'ultra'), __('1 Comment', 'ultra'), __('% Comments', 'ultra')); echo '</span>'; } echo '</div>'; if (is_single() && siteorigin_setting('navigation_post_nav')) { the_post_navigation($args = array('prev_text' => '', 'next_text' => '')); } }
/** * Prints HTML with meta information for the categories, tags and comments. */ function great_entry_footer() { // Featured Star if (is_sticky() && is_home() && !is_paged()) { printf('<span class="sticky-post"><i class="fa fa-star"></i> %s</span>', __('Featured', 'great')); } // Post Author if (get_theme_mod('display_post_author', 1)) { $byline = ' <span class="author vcard"> <a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '"> ' . esc_html(get_the_author()) . '</a></span>'; echo '<span class="byline"><i class="fa fa-user"></i> ' . $byline . '</span>'; } // Hide category and tag text for pages. if ('post' == get_post_type()) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list(__(', ', 'great')); if ($categories_list && great_categorized_blog() && get_theme_mod('display_post_cats', 1)) { printf('<span class="cat-links"><i class="fa fa-folder"></i> ' . '%1$s' . '</span>', $categories_list); } /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list('', __(', ', 'great')); if ($tags_list and get_theme_mod('display_post_tags', 1)) { printf('<span class="tags-links"><i class="fa fa-tags"></i> ' . '%1$s' . '</span>', $tags_list); } } }
/** * Create a list of actions for the specified page * * @param string $page Page to get Actions for. * * @return array of actions */ public function get_page_actions($page) { /** * Actions to be executed */ $actions = array('always'); // Singular = single item (post, attachment, page, etc). if (is_singular()) { $actions[] = 'singular'; } // Paged page (pagination). if (is_paged()) { $actions[] = 'paged'; } if (is_sticky()) { $actions[] = 'sticky'; } if (is_user_logged_in()) { $actions[] = 'logged-in'; $actions[] = 'loggedin'; } if (in_array($page, $this->archive_pages, true) || 'home' === $page) { $actions[] = 'archived'; } // Add page action. $actions[] = $page; // Apply filters. $actions = Stencil_Environment::filter('actions-' . $page, $actions); $actions = Stencil_Environment::filter('actions', $actions); return $actions; }
/** * Copy post metas, menu order, comment and ping status when using "Add new" ( translation ) * formerly used dbx_post_advanced deprecated in WP 3.7 * * @since 1.2 * * @param string $post_type unused * @param object $post current post object */ public function add_meta_boxes($post_type, $post) { if ('post-new.php' == $GLOBALS['pagenow'] && isset($_GET['from_post'], $_GET['new_lang']) && $this->model->is_translated_post_type($post->post_type)) { // Capability check already done in post-new.php $from_post_id = (int) $_GET['from_post']; $from_post = get_post($from_post_id); $lang = $this->model->get_language($_GET['new_lang']); if (!$from_post || !$lang) { return; } $this->copy_taxonomies($from_post_id, $post->ID, $lang->slug); $this->copy_post_metas($from_post_id, $post->ID, $lang->slug); foreach (array('menu_order', 'comment_status', 'ping_status') as $property) { $post->{$property} = $from_post->{$property}; } // Copy the date only if the synchronization is activated if (in_array('post_date', $this->options['sync'])) { $post->post_date = $from_post->post_date; $post->post_date_gmt = $from_post->post_date_gmt; } if (is_sticky($from_post_id)) { stick_post($post->ID); } } }
/** * Prints HTML with meta information for the categories, tags. * * @since Pure 1.0 */ function pure_entry_meta() { if (is_sticky() && is_home() && !is_paged()) { printf('<span class="sticky-post">%s</span>', __('Featured', 'pure')); } if ('post' == get_post_type()) { printf('<span class="byline"><span class="author vcard"><i class="fa fa-user"></i><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.', 'pure'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author()); } if (in_array(get_post_type(), array('post', 'attachment'))) { $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' ) ), is_single() ? pure_get_time_ago( get_post_time( 'c', true ) ), esc_attr( get_the_modified_date( 'c' ) ), get_the_modified_date() );*/ $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><i class="fa fa-clock-o"></i><a href="%2$s" rel="bookmark">%3$s</a></span>', _x('Posted on', 'Used before publish date.', 'pure'), esc_url(get_permalink()), $time_string); } if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) { echo '<span class="comments-link"><i class="fa fa-comment-o"></i>'; comments_popup_link(__('Leave a comment', 'pure'), __('1 Comment', 'pure'), __('% Comments', 'pure')); echo '</span>'; } return; }
/** * Prints HTML with meta information for current post: categories, tags, permalink, author, and date. * * @return void */ function wheels_entry_meta() { if (is_sticky() && is_home() && !is_paged()) { echo '<span class="featured-post">' . __('Sticky', 'wheels') . '</span>'; } if (!has_post_format('link') && 'post' == get_post_type()) { wheels_entry_date(); } // Translators: used between list items, there is a space after the comma. $categories_list = get_the_category_list(__(', ', 'wheels')); if ($categories_list) { echo '/<span class="categories-links">' . $categories_list . '</span>'; } // Translators: used between list items, there is a space after the comma. $tag_list = get_the_tag_list('', __(', ', 'wheels')); if ($tag_list) { echo '/<span class="tags-links">' . $tag_list . '</span>'; } // Post author if ('post' == get_post_type()) { printf('/<span class="author vcard">%1$s <a class="url fn n" href="%2$s" title="%3$s" rel="author">%4$s</a></span>', __('by', 'wheels'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'wheels'), get_the_author())), get_the_author()); $num_comments = get_comments_number(); // get_comments_number returns only a numeric value if ($num_comments == 0) { } else { if ($num_comments > 1) { $comments = $num_comments . __(' Comments', 'wheels'); } else { $comments = __('1 Comment', 'wheels'); } echo $write_comments = '/<span class="comments-count"><a href="' . get_comments_link() . '">' . $comments . '</a></span>'; } } }
function matraman_lite_post_type() { if (has_post_format('gallery')) { echo '<i class="icon post-type icon-photos-pictures"></i>'; } if (has_post_format('audio')) { echo '<i class="icon post-type icon-headphone"></i>'; } if (has_post_format('chat')) { echo '<i class="icon post-type icon-chat-talk"></i>'; } if (has_post_format('image')) { echo '<i class="icon post-type icon-camera"></i>'; } if (has_post_format('link')) { echo '<i class="icon post-type icon-link"></i>'; } if (has_post_format('quote')) { echo '<i class="icon post-type icon-quote-left"></i>'; } if (has_post_format('video')) { echo '<i class="icon post-type icon-film-maker"></i>'; } if (has_post_format('status')) { echo '<i class="icon post-type icon-message-talk"></i>'; } if (!get_post_format() && !is_sticky()) { echo '<i class="icon post-type icon-book"></i>'; } if (is_sticky()) { echo '<i class="icon post-type icon-pin"></i>'; } }
function wpthemes_post_class($class = '', $post_id = null) { $post = get_post($post_id); $classes = array(); $classes[] = $post->post_type; if (is_sticky($post->ID) && is_home()) { $classes[] = 'sticky'; } $classes[] = 'hentry'; foreach ((array) get_the_category($post->ID) as $cat) { if (empty($cat->slug)) { continue; } $classes[] = 'category-' . $cat->slug; } foreach ((array) get_the_tags($post->ID) as $tag) { if (empty($tag->slug)) { continue; } $classes[] = 'tag-' . $tag->slug; } if (!empty($class)) { if (!is_array($class)) { $class = preg_split('#\\s+#', $class); } $classes = array_merge($classes, $class); } return apply_filters('post_class', $classes, $class, $post_id); }
function wpsight_do_widget_post_meta() { $post_meta = '[post_date] ' . __('in', 'wpsight') . ' [post_categories] [post_edit before="- "]'; // Add badge for sticky posts $sticky = is_sticky() && (is_home() || is_page_template('page-tpl-blog.php')) ? apply_filters('wpsight_post_sticky', '<span class="label label-info">' . __('Sticky', 'wpsight') . '</span> ') : ''; printf('<div class="post-meta">%2$s%1$s</div>', apply_filters('wpsight_do_widget_post_meta', $post_meta), $sticky); }
function ro_theme_author_render() { ob_start(); ?> <?php if (is_sticky() && is_home() && !is_paged()) { ?> <span class="featured-post"> <?php _e('Sticky', 'robusta'); ?> </span> <?php } ?> <div class="ro-about-author clearfix"> <div class="ro-author-avatar"><?php echo get_avatar(get_the_author_meta('ID'), 170); ?> </div> <div class="ro-author-info"> <h6 class="ro-name"><?php the_author(); ?> </h6> <?php the_author_meta('description'); ?> </div> </div> <?php return ob_get_clean(); }
function vw_render_categories($classes = '') { $categories = get_the_category(); $html = ''; if (is_sticky()) { $html .= '<div class="label label-sticky ' . $classes . '" title="' . __('Sticky Post', 'envirra') . '"><i class="icon-entypo-megaphone"></i></div>'; } if ('post' == get_post_type()) { if ('1' == get_post_meta(get_the_id(), 'vw_enable_review', true)) { $avg_score = get_post_meta(get_the_id(), 'vw_review_average_score', true); $html .= '<div class="label label-review ' . $classes . '" title="' . __('Classificação', 'envirra') . '"><i class="icon-entypo-star"></i> ' . $avg_score . '</div>'; } else { // Show post format if not a review if ('gallery' == get_post_format()) { $html .= '<div class="label label-light ' . $classes . '" title="' . __('Gallery Post', 'envirra') . '"><i class="icon-entypo-picture"></i></div>'; } else { if ('video' == get_post_format()) { $html .= '<div class="label label-light ' . $classes . '" title="' . __('Video Post', 'envirra') . '"><i class="icon-entypo-play"></i></div>'; } else { if ('audio' == get_post_format()) { $html .= '<div class="label label-light ' . $classes . '" title="' . __('Audio Post', 'envirra') . '"><i class="icon-entypo-note-beamed"></i></div>'; } } } } } if ($categories) { foreach ($categories as $category) { $html .= '<a class="label ' . $classes . '" href="' . get_category_link($category->term_id) . '" title="' . esc_attr(sprintf(__("Ver Artigos na Categoria %s", 'envirra'), $category->name)) . '" rel="category">' . $category->cat_name . '</a>'; } } echo $html; }
function addStickyClass($classes, $class, $post_id) { if (is_sticky() && is_category() && !isset($classes['sticky'])) { $classes[] = 'sticky'; } return $classes; }
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>'; } }
/** * Prints HTML with meta information for the current post-date/time and author. */ function impronta_metadata() { // Hide category and tag text for pages. if ('post' === get_post_type()) { echo '<p class="metadata">'; $byline = sprintf(esc_html_x('By %s', 'post author', 'impronta'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span> '); echo $byline; /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list(esc_html__(', ', 'impronta')); if ($categories_list && impronta_categorized_blog()) { printf('<span class="cat-links">' . esc_html_x('on %1$s ', 'on categories', 'impronta') . '</span>', $categories_list); // WPCS: XSS OK. } /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list('', esc_html__(', ', 'impronta')); if ($tags_list) { printf(esc_html__('tagged %1$s', 'impronta'), $tags_list); // WPCS: XSS OK. } if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) { if (get_comments_number(get_the_id()) == 0) { echo esc_html__('- ', 'impronta'); } else { echo esc_html__('with ', 'impronta'); } comments_popup_link(esc_html__('Leave a comment', 'impronta'), esc_html__('1 Comment', 'impronta'), esc_html__('% Comments', 'impronta')); } if (is_sticky()) { echo ' - ' . '<i class="feature-star fa fa-star" data-toggle="tooltip" data-placement="right" title="' . esc_attr__('Featured Post', 'impronta') . '"></i>'; } echo '</p>'; } }
/** * Creates a set of classes for each site entry upon display. Each entry is given the class of * 'hentry'. Posts are given category, tag, and author classes. Alternate post classes of odd, * even, and alt are added. * * @param string|array $class One or more classes to add to the class list. * @param int $post_id An optional post ID. * @return array * @since 1.1 */ function momtaz_get_post_class($class = '', $post_id = 0) { $classes = array(); // Get post object $post = get_post($post_id); if (empty($post)) { return $classes; } // hAtom compliance. $classes[] = 'hentry'; // Get post context. $context = momtaz_get_post_context($post_id); // Merge the classes array with post context. $classes = array_merge($classes, (array) $context); // Post taxonomies $post_taxonomies = get_post_taxonomies($post); if (!empty($post_taxonomies)) { foreach ($post_taxonomies as $taxonomy) { $terms = get_the_terms($post->ID, $taxonomy); if (!empty($terms)) { foreach ($terms as $term) { $classes[] = 'term-' . sanitize_html_class($term->slug, $term->term_id); } } } } // Sticky posts. if (is_home() && !is_paged() && is_sticky($post->ID)) { $classes[] = 'sticky'; } // Is this post protected by a password? if (post_password_required($post)) { $classes[] = 'post-password-required'; } // Post alt class. if (!momtaz_is_the_single($post)) { static $post_alt = 0; $classes[] = 'set-' . ++$post_alt; $classes[] = $post_alt % 2 ? 'odd' : 'even'; } // Has a custom excerpt? if (has_excerpt($post)) { $classes[] = 'has-excerpt'; } // Custom classes. if (!empty($class)) { if (!is_array($class)) { $class = preg_split('#\\s+#', $class); } $classes = array_merge($classes, $class); } // Apply the WordPress filters. $classes = apply_filters('post_class', $classes, $class, $post->ID); // Apply the Momtaz FW filters. $classes = apply_filters('momtaz_get_post_class', $classes, $post); // Removes any duplicate and empty classes. $classes = array_unique(array_filter($classes)); return $classes; }
/** * Print HTML with meta information for the current post-date/time and author. * * @since Twenty Fourteen 1.0 */ function rms_posted_on() { if (is_sticky() && is_home() && !is_paged()) { echo '<span class="featured-post">' . __('Sticky', 'deepocean') . '</span>'; } // Set up and print post meta information. printf('<span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>', get_permalink(), esc_attr(get_the_date('c')), esc_html(get_the_date()), get_author_posts_url(get_the_author_meta('ID')), get_the_author()); }
/** Contango Post Sticky */ function contango_post_sticky() { $output = ''; if (is_sticky()) { $output = sprintf('%2$s <span class="entry-meta-featured">%1$s</span>', __('Featured', 'contango'), contango_entry_meta_sep()); } return $output; }
/** * Adds relevant post classes. * * - Adds `well` and `well-lg` to sticky posts in home. * * @param Array $classes Classes. * @return Array Classes with possible additions. */ function bootstwatch_post_classes($classes) { if (is_sticky() && is_home()) { $classes[] = 'well'; $classes[] = 'well-lg'; } return $classes; }
function odin_posted_small() { if (is_sticky() && is_home() && !is_paged()) { echo '<span class="featured-post">' . __('Sticky', 'morfeu') . ' </span>'; } // Set up and print post meta information. printf('<span class="entry-date"> <i class="icon-circle glyphicon glyphicon-calendar"></i> <time class="entry-date" datetime="%s">%s</time></span>', esc_attr(get_the_date('c')), esc_html(get_the_date())); }
/** * Print HTML with meta information for the current post-date/time and author. * * @since 2.2.0 * * @return void */ function vulcano_posted_on() { if (is_sticky() && is_home() && !is_paged()) { echo '<span class="featured-post">' . __('Sticky', 'vulcano') . ' </span>'; } // Set up and print post meta information. printf('<span class="entry-date">%s <time class="entry-date" datetime="%s">%s</time></span> <span class="byline">%s <span class="author vcard"><a class="url fn n" href="%s" rel="author">%s</a></span>.</span>', __('Posted in', 'vulcano'), esc_attr(get_the_date('c')), esc_html(get_the_date()), __('by', 'vulcano'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author()); }
/** * Print HTML with meta information for the current post-date/time and author. * * @since Anciela 1.0 */ function anciela_posted_on() { // Set up and print post meta information. printf('<time class="entry-date" datetime="%1$s">%2$s</time>', esc_attr(get_the_date('c')), esc_html(get_the_date())); if (is_sticky() && is_home() && !is_paged()) { echo '<span class="featured-post">' . __('Actualité à la une', 'anciela') . '</span>'; } }
/** * Get current page "type" in the way WordPress handles it * * Concerned page types are: * * - 'default_home': default wordpress: auto-generated homepage => front-page.php * - 'front_page': user defined front page (homepage post) => front-page.php * - 'home': user defined blog page (post) => home.php * - 'search' * - '401' * - '403' * - '404' * - 'attachment': single attachment * - 'page': single post with type "page" * - 'post_sticky': single post with the featured option enabled * - 'post_XXX': single custom post type post * - 'post': single post * - 'tag': one tag archive * - 'category': one category archive * - 'author': single author / archive of author's posts * - 'post_type_archive_XXX': XXX custom post type archive * - 'post_type_archive': post type archive * - 'taxonomy': one taxonomy archive * - 'date': archive by date * - 'archive': global archive page * - 'index': this is the default type when no other one matches * * @return string */ function get_page_type() { global $page_type; if (!isset($page_type)) { $page_type = 'index'; if (is_front_page() && is_home()) { // default wordpress: auto-generated homepage => front-page.php $page_type = 'default_home'; } elseif (is_front_page()) { // user defined front page (homepage post) => front-page.php $page_type = 'front_page'; } elseif (is_home()) { // user defined blog page (post) => home.php $page_type = 'home'; } elseif (is_search()) { $page_type = 'search'; } elseif (is_401()) { $page_type = '401'; } elseif (is_403()) { $page_type = '403'; } elseif (is_404()) { $page_type = '404'; } elseif (is_single() && is_attachment()) { $page_type = 'attachment'; } elseif (is_page()) { $page_type = 'page'; } elseif (is_single() && is_sticky()) { $page_type = 'post_sticky'; } elseif (is_single()) { $post_type = get_post_type(); if ($post_type) { $page_type = 'post_' . $post_type; } else { $page_type = 'post'; } } elseif (is_archive() && is_tag()) { $page_type = 'tag'; } elseif (is_archive() && is_category()) { $page_type = 'category'; } elseif (is_archive() && is_author()) { $page_type = 'author'; } elseif (is_archive() && is_post_type_archive()) { $post_type = get_post_type(); if ($post_type) { $page_type = 'post_type_archive_' . $post_type; } else { $page_type = 'post_type_archive'; } } elseif (is_archive() && is_tax()) { $page_type = 'taxonomy'; } elseif (is_archive() && (is_date() || is_year() || is_month() || is_day() || is_time())) { $page_type = 'date'; } elseif (is_archive()) { $page_type = 'archive'; } } return $page_type; }
/** * Returns the icon denoting the current post format * * @param string $format post format name * @return string icon name */ public static function get_post_format_icon($format) { if (is_sticky()) { return 'pushpin'; } $formats = apply_filters('wpv_post_format_icons', array('aside' => 'notebook', 'audio' => 'music2', 'gallery' => 'theme-gallery', 'image' => 'theme-camera', 'link' => 'link', 'quote' => 'quotes-right2', 'standard' => 'pencil1', 'status' => 'notebook', 'video' => 'theme-video')); if (isset($formats[$format])) { return $formats[$format]; } return 'theme-pencil'; }
/** * Prints HTML with meta information for the categories, tags. * * @since Twenty Fifteen 1.0 */ function _esc_entry_meta($position = 'footer') { if ($position == 'header') { 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 ($position == 'header') { 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"><i class="fa fa-calendar"></i><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 ($position == 'header') { if (is_singular() || is_multi_author()) { printf('<span class="byline"><i class="fa fa-user"></i><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()); } return; } $categories_list = get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen')); if ($categories_list && _esc_categorized_blog()) { printf('<span class="cat-links"><i class="fa fa-folder-open"></i><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"><i class="fa fa-tags"></i><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 × %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 '<span class="comments-link">'; /* translators: %s: post title */ comments_popup_link(sprintf(__('Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentyfifteen'), get_the_title())); echo '</span>'; } }
function flipster_get_meta_data($force_meta = false) { $output = ''; //Check for sticky if (is_sticky()) { $output = $output .= '<div class="meta-item"><i class="fa fa-thumb-tack"></i>' . __('Sticky', 'flipster') . '</div>'; } //Check meta options if (!$force_meta) { if (is_single()) { $metas = flipster_get_option('single_meta'); } else { $metas = flipster_get_option('meta'); } } else { $metas = array($force_meta); } if (!empty($metas)) { foreach ($metas as $meta_id) { $meta = ''; switch ($meta_id) { case 'date': $meta = '<i class="fa fa-calendar"></i><span class="updated">' . get_the_date() . '</span>'; break; case 'author': $author_id = get_post_field('post_author', get_the_ID()); $meta = '<i class="fa fa-user"></i><span class="vcard author"><span class="fn">' . __('by', 'flipster') . ' <a href="' . esc_url(get_author_posts_url(get_the_author_meta('ID', $author_id))) . '">' . get_the_author_meta('display_name', $author_id) . '</a></span></span>'; break; case 'rtime': $meta = flipster_read_time(get_post_field('post_content', get_the_ID())); if (!empty($meta)) { $meta = '<i class="fa fa-clock-o"></i>' . $meta . ' ' . __('min read', 'flipster'); } break; case 'comments': if (comments_open() || get_comments_number()) { ob_start(); comments_popup_link(__('Add Comment', 'flipster'), __('1 Comment', 'flipster'), __('% Comments', 'flipster')); $meta = '<i class="fa fa-comments-o"></i>' . ob_get_contents(); ob_end_clean(); } else { $meta = ''; } break; default: break; } if (!empty($meta)) { $output .= '<div class="meta-item">' . $meta . '</div>'; } } } return $output; }
function decode_render_infinte_scroll() { while (have_posts()) { the_post(); if (get_theme_mod('use_excerpts', false) == true && !is_sticky()) { get_template_part('content', 'excerpt'); } else { get_template_part('content', get_post_format()); } } }
function shopkeeper_entry_archives() { if (is_sticky() && is_home() && !is_paged()) { echo '<span class="featured-post">' . __('Sticky', 'shopkeeper') . '</span>'; } // Post author if ('post' == get_post_type()) { printf(__(' by ', 'shopkeeper') . '<a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'shopkeeper'), get_the_author())), get_the_author()); } //if ( ! has_post_format( 'link' ) && 'post' == get_post_type() ) shopkeeper_entry_date(); }
/** * Post featured tag * in format-standard * * @since 1.0.0 */ function reactor_do_standard_format_sticky() { if (is_sticky()) { ?> <div class="entry-featured"> <span class="label secondary"><?php echo apply_filters('reactor_featured_post_title', __('Featured Post', 'reactor')); ?> </span> </div> <?php } }
/** * Excerpt length */ function planar_excerpt_length($length) { if (is_sticky()) { $length = 50; } elseif (is_page()) { $length = 30; } elseif (is_home() || is_category() || is_archive()) { $length = 30; } else { $length = 20; } return $length; }
/** * Replace submitdiv(metabox) HTML * @param object $post */ function replace_submitdiv($post) { ob_start(); post_submit_meta_box($post); $buff = ob_get_clean(); if (preg_match('!(^.*)(<label for="visibility-radio-public")(.*)(<input type="radio" name="visibility" id="visibility-radio-password")(.*$)!is', $buff, $matches)) { $buff = sprintf('%s%s%s<span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" %s tabindex="4" /> <label for="sticky" class="selectit">%s</label><br /></span>%s%s', $matches[1], $matches[2], $matches[3], checked(is_sticky($post->ID), true, false), __('Stick this post to the front page'), $matches[4], $matches[5]); } if (is_sticky($post->ID)) { $buff = preg_replace('!(<span id="post-visibility-display">)[^<]*(</span>)!is', sprintf('$1%s$2', __('Public, Sticky')), $buff); } echo $buff; }