Exemplo n.º 1
0
/**
 * Displays an HTML link to the author page of the current post's author.
 *
 * @since 1.2.0
 * @since 4.4.0 Converted into a wrapper for get_the_author_posts_link()
 *
 * @param string $deprecated Unused.
 */
function the_author_posts_link($deprecated = '')
{
    if (!empty($deprecated)) {
        _deprecated_argument(__FUNCTION__, '2.1');
    }
    echo get_the_author_posts_link();
}
Exemplo n.º 2
0
 /**
  * @ticket 30355
  */
 public function test_get_the_author_posts_link_with_permalinks()
 {
     $this->set_permalink_structure('/%postname%/');
     $author = self::factory()->user->create_and_get(array('display_name' => 'Foo', 'user_nicename' => 'bar'));
     $GLOBALS['authordata'] = $author;
     $link = get_the_author_posts_link();
     $url = sprintf('http://%1$s/author/%2$s/', WP_TESTS_DOMAIN, $author->user_nicename);
     $this->set_permalink_structure('');
     $this->assertContains($url, $link);
     $this->assertContains('Posts by Foo', $link);
     $this->assertContains('>Foo</a>', $link);
     unset($GLOBALS['authordata']);
 }
Exemplo n.º 3
0
<div class="entry-meta">
	<?php 
// Dont display publisher schema on attachment pages
if (!is_attachment()) {
    // Create publisher block
    $publisher_schema = '<div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">';
    $publisher_schema .= '<meta itemprop="name" content="' . esc_attr(get_bloginfo('name')) . '">';
    $publisher_schema .= '<div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">';
    $publisher_schema .= '<meta itemprop="url" content="' . esc_url(get_template_directory_uri() . '/assets/images/publisher-logo.png') . '">';
    $publisher_schema .= '<meta itemprop="width" content="600">';
    $publisher_schema .= '<meta itemprop="height" content="60">';
    $publisher_schema .= '</div></div>';
    // Display publisher block
    echo $publisher_schema;
}
?>
	<?php 
// Add author schema when not on attachment page
$author_schema = !is_attachment() ? ' itemprop="author"' : '';
echo '<p class="author"' . $author_schema . '>' . get_the_author_posts_link() . '</p>';
?>
	<?php 
// Add date published schema when not on attachment page
$date_schema = !is_attachment() ? ' itemprop="datePublished"' : '';
echo '<p class="date"' . $date_schema . '>' . get_the_time(get_option('date_format')) . '</p>';
// Dont display modified date schema on attachment pages
if (!is_attachment()) {
    echo '<meta itemprop="dateModified" content="' . esc_attr(get_the_modified_date(get_option('date_format'))) . '"/>';
}
?>
</div>
Exemplo n.º 4
0
            </section> <!-- end article section -->

            <header class="article-header">
                <h4><a href="<?php 
the_permalink();
?>
" rel="bookmark" title="<?php 
the_title_attribute();
?>
"><?php 
the_title();
?>
</a></h4>
                <?php 
/* Translators: %1$s is the time, %2$s is the link to the author's archive, %3$s is the category */
printf('<p>' . __('%1$s by %2$s. %3$s', 'jointswp') . '</p>', get_the_time('F j, Y'), get_the_author_posts_link(), get_the_category_list(__(', ', 'jointswp')));
?>
            </header> <!-- end article header -->

            <section class="entry-content" itemprop="articleBody">
                <?php 
the_content('<button class="tiny">' . __('Read more...', 'jointswp') . '</button>');
?>
            </section> <!-- end article section -->

        </article> <!-- end article -->

    </div>

    <?php 
if (0 === ($wp_query->current_post + 1) % $grid_columns || $wp_query->current_post + 1 === $wp_query->post_count) {
		<?php 
    }
    ?>

		<?php 
    if (!is_page()) {
        ?>
			<div class="post-meta">
				<?php 
        $post_date_format = date_i18n(get_option('date_format'), get_the_time('U'));
        ?>
				<?php 
        if (get_theme_mod('ubuntucommunity_showauthor') == true) {
            ?>
					<span class="post-author-date"><?php 
            printf(_x('By %s on %s', 'post meta: author, formatted date', 'ubuntu-community'), get_the_author_posts_link(), $post_date_format);
            ?>
</span>
				<?php 
        } else {
            ?>
					<span class="post-date"><?php 
            echo $post_date_format;
            ?>
</span>
				<?php 
        }
        ?>
			</div>
		<?php 
    }
Exemplo n.º 6
0
 public static function get_the_post_meta($post = null)
 {
     $post = get_post($post);
     if (!$post) {
         return;
     }
     $output = '';
     if (in_array($post->post_type, self::$show_post_date, true)) {
         $output .= '<li class="post-date"><span class="screen-reader-text">' . _x('Posted on', 'Used before the post date.', 'wp-starter-theme') . ' </span><time datetime="' . esc_attr(get_post_time('c', false, $post)) . '">' . self::get_the_post_date($post) . '</time></li>';
         if (self::is_modified_different($post)) {
             $output .= '<li class="post-modified-date"><span class="screen-reader-text">' . _x('Last Edited on', 'Used before the post modified date.', 'wp-starter-theme') . ' </span><time datetime="' . esc_attr(get_post_modified_time('c', false, $post)) . '">' . self::get_the_post_modified_date($post) . '</time></li>';
         }
     }
     if (post_type_supports($post->post_type, 'author') && is_multi_author()) {
         $output .= '<li class="post-author"><span class="screen-reader-text">' . _x('Author', 'Used before the post author name.', 'wp-starter-theme') . ' </span>' . get_the_author_posts_link() . '</li>';
     }
     switch ($post->post_type) {
         case 'attachment':
             //TODO
             break;
         case 'page':
             break;
         case 'post':
             if (self::is_multi_categories()) {
                 $output .= get_the_term_list($post->ID, 'category', '<li class="post-categories"><span class="screen-reader-text">' . _x('Categories', 'Used before category names.', 'leavesandlove-v5') . ' </span>', ', ', '</li>');
             }
             if (self::is_multi_tags()) {
                 $output .= get_the_term_list($post->ID, 'post_tag', '<li class="post-tags"><span class="screen-reader-text">' . _x('Tags', 'Used before tag names.', 'leavesandlove-v5') . ' </span>', ', ', '</li>');
             }
             if (current_theme_supports('post-formats') && self::is_multi_post_formats()) {
                 $output .= '<li class="post-format"><span class="screen-reader-text">' . _x('Post Format', 'Used before the post format.', 'leavesandlove-v5') . ' </span>' . self::get_the_post_format($post) . '</li>';
             }
             break;
         default:
             $taxonomies = get_object_taxonomies($post);
             foreach ($taxonomies as $taxonomy) {
                 if ('post_format' === $taxonomy) {
                     continue;
                 }
                 $class = 'post-';
                 if ('category' === $taxonomy) {
                     $class .= 'categories';
                 } elseif ('post_tag' === $taxonomy) {
                     $class .= 'tags';
                 } else {
                     $class .= $taxonomy;
                 }
                 if (self::is_multi_terms($taxonomy)) {
                     $taxonomy_label = _x('Terms', 'Used before term names.', 'wp-starter-theme');
                     if (false !== ($taxonomy_obj = get_taxonomy($taxonomy))) {
                         $taxonomy_label = $taxonomy_obj->labels->name;
                     }
                     $output .= get_the_term_list($post->ID, $taxonomy, '<li class="' . $class . '"><span class="screen-reader-text">' . $taxonomy_label . ' </span>', ', ', '</li>');
                 }
             }
             if (current_theme_supports('post-formats') && post_type_supports($post->post_type, 'post-formats') && self::is_multi_post_formats()) {
                 $output .= '<li class="post-format"><span class="screen-reader-text">' . _x('Post Format', 'Used before the post format.', 'wp-starter-theme') . ' </span>' . self::get_the_post_format($post) . '</li>';
             }
     }
     if (post_type_supports($post->post_type, 'comments') && !post_password_required($post) && (comments_open($post->ID) || get_comments_number($post->ID))) {
         $output .= '<li class="post-comments-link">' . self::get_the_comments_popup_link($post) . '</li>';
     }
     if (is_user_logged_in()) {
         ob_start();
         self::edit_post_link(null, '<li class="post-edit-link">', '</li>', $post->ID);
         $output .= ob_get_clean();
     }
     if (!empty($output)) {
         $output = '<ul class="post-meta post-meta-' . $post->post_type . '">' . $output . '</ul>';
     }
     return $output;
 }
Exemplo n.º 7
0
<?php

/* Translators: %1$s is the time, %2$s is the link to the author's archive, %3$s is the category */
printf('<p class="byline">' . __('Posted on %1$s by %2$s - %3$s', 'jointswp') . '</p>', get_the_time('F j, Y'), get_the_author_posts_link(), get_the_category_list(__(', ', 'jointswp')));
Exemplo n.º 8
0
/**
 * Backwards compatible wrapper for get_the_author_posts_link() which was
 * added to WordPress core in 4.4.
 *
 * @since  1.0.0
 * @access public
 * @return string
 */
function _carelib_get_the_author_posts_link()
{
    if (function_exists('get_the_author_posts_link')) {
        return get_the_author_posts_link();
    }
    ob_start();
    the_author_posts_link();
    return ob_get_clean();
}
<p class="card-text"><small class="text-muted">
	<?php 
printf(__('Posted on %s by  %s - %s', 'jbst-4'), get_the_time('F j, Y'), esc_url(get_the_author_posts_link()), esc_html(implode(",", get_the_category())));
?>
</small></p>	
<?php

/**
 * @package WP_Basic_Bootstrap
 * @since WP_Basic_Bootstrap 1.0
 */
?>
<div class="entry-meta blog-post-meta">
    <?php 
printf(__('by %1$s on %2$s', 'basicbootstrap'), '<cite class="entry-meta-item author vcard" itemprop="author">' . get_the_author_posts_link() . '</cite>', '<time datetime="' . get_the_time('c') . '" class="entry-meta-item post-date entry-date updated" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>');
$post = get_post();
if (substr($post->post_modified_gmt, 0, 10) != substr($post->post_date_gmt, 0, 10)) {
    printf(__(', last updated at %1$s', 'basicbootstrap'), '<time datetime="' . get_the_modified_date('c') . '" class="entry-meta-item post-date entry-date updated" itemprop="dateModified">' . get_the_modified_date(get_option('date_format')) . '</time>');
}
?>
</div>
Exemplo n.º 11
0
    /**
     * Render the widget in frontend
     *
     * @param array $args
     * @param array $instance
     * @return string
     */
    function get_widget($args, $instance)
    {
        if (is_admin()) {
            return "<center><i class='icon-list-alt  icon-4x'></i></center>";
        }
        $output = '';
        if (empty($instance['categories'])) {
            $instance['categories'] = "";
        }
        if (isset($instance['link']) && isset($instance['blog_type']) && $instance['blog_type'] == 'taxonomy') {
            //$instance['link'] = explode(',', $instance['link'], 2);
            $instance['taxonomy'] = $instance['link'][0];
            if (!empty($instance['link'][1])) {
                $instance['categories'] = $instance['link'][1];
            } else {
                if (!empty($instance['taxonomy'])) {
                    $taxonomy_terms_obj = get_terms($instance['taxonomy']);
                    foreach ($taxonomy_terms_obj as $taxonomy_term) {
                        $instance['categories'] .= $taxonomy_term->term_id . ',';
                    }
                }
            }
        }
        $instance = wp_parse_args($instance, array('blog_style' => '', 'columns' => 3, 'blog_type' => 'posts', 'items' => '16', 'paginate' => 'yes', 'categories' => '', 'preview_mode' => 'auto', 'image_size' => '6_column', 'post_type' => 'post', 'taxonomy' => 'category', 'contents' => 'excerpt', 'content_length' => 'content', 'offset' => '0', 'excerpt_length' => '55', 'post_meta' => '1', 'widget_title' => ''));
        $this->excerpt_length = $instance['excerpt_length'];
        add_filter('excerpt_length', array($this, 'custom_excerpt_length'), 999);
        $this->query_entries($instance);
        $instance['blog_content'] = $instance['content_length'];
        $instance['remove_pagination'] = $instance['paginate'] === "yes" ? false : true;
        //print_r($instance);
        $more = 0;
        //ob_start(); //start buffering the output instead of echoing it
        //include_once ReduxPageBuilder::$_dir . '/inc/loop-index.php';
        global $options, $post_loop_count, $wp_query;
        //default for temprory
        $options['blog_style'] = 'small-featured';
        $options['single_post_style'] = 'small-featured';
        if (empty($post_loop_count)) {
            $post_loop_count = 1;
        }
        $blog_style = !empty($instance['blog_style']) ? $instance['blog_style'] : $options['blog_style'];
        //if (is_single())
        //    $blog_style = $options['single_post_style'];
        $blog_content = !empty($instance['blog_content']) ? $instance['blog_content'] : "content";
        //        $output = "
        //            <style type='text/css'>
        //                .Redux_Widget_video{
        //                    display: none;
        //                }
        //            </style>
        //         ";
        ?>

        <?php 
        if (!empty($instance['widget_title'])) {
            $output .= "<h3 class='widget-title blog-widget-title'>{$instance['widget_title']}</h3>";
        }
        // check if we got posts to display:
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                /*
                 * get the current post id, the current post class and current post format
                 */
                $column_width = "";
                switch ($blog_style) {
                    case 'list-large':
                    case 'list-medium':
                    case 'list-small':
                        $column_width = "col-md-12";
                        break;
                    case 'grid-medium':
                        $column_width = "col-md-4";
                        break;
                    case 'grid-small':
                        $column_width = "col-md-3 col-xs-4";
                        break;
                    case 'grid-mini':
                        $column_width = "col-md-2 col-xs-3";
                        break;
                }
                $the_id = get_the_ID();
                $parity = $post_loop_count % 2 ? 'odd' : 'even';
                $last = count($wp_query->posts) == $post_loop_count ? " post-entry-last " : "";
                $post_class = "post-entry-" . $the_id . " post-loop-" . $post_loop_count . " post-parity-" . $parity . $last . " " . $column_width . " ";
                $post_format = get_post_format() ? get_post_format() : 'standard';
                /*
                 * retrieve slider, title and content for this post,...
                 */
                $size = '9_culomn';
                if (!empty($instance['preview_mode']) && !empty($instance['image_size']) && $instance['preview_mode'] == 'custom') {
                    $size = $instance['image_size'];
                }
                $current_post['slider'] = get_the_post_thumbnail($the_id, $size);
                $current_post['title'] = get_the_title();
                $current_post['content'] = $blog_content == "content" ? get_the_content(__('Read more', 'redux-page-builder') . '<span class="more-link-arrow">  &rarr;</span>') : get_the_excerpt();
                $current_post['content'] = $blog_content == "excerpt_read_more" ? $current_post['content'] . '<div class="read-more-link"><a href="' . get_permalink() . '" class="more-link">' . __('Read more', 'redux-page-builder') . '<span class="more-link-arrow">  &rarr;</span></a></div>' : $current_post['content'];
                $current_post['before_content'] = "";
                /*
                 * ...now apply a filter, based on the post type... (filter function is located in includes/helper-post-format.php)
                 */
                $current_post = apply_filters('post-format-' . $post_format, $current_post);
                $with_slider = empty($current_post['slider']) ? "" : "with-slider";
                /*
                 * ... last apply the default wordpress filters to the content
                 */
                $current_post['content'] = str_replace(']]>', ']]&gt;', apply_filters('the_content', $current_post['content']));
                /*
                 * Now extract the variables so that $current_post['slider'] becomes $slider, $current_post['title'] becomes $title, etc
                 */
                extract($current_post);
                /*
                 * render the html:
                 */
                $output .= "<article class=' " . implode(" ", get_post_class('post-entry post-entry-type-' . $post_format . " " . $post_class . " " . $with_slider)) . "' " . schema_markup(array('context' => 'entry', 'echo' => false)) . "><div class='inner-entry post-loop'>";
                //default link for preview images
                $link = get_permalink();
                //echo preview image
                //if (strpos($blog_style, 'big') !== false) {
                if ($slider) {
                    $slider = '<a href="' . $link . '">' . $slider . '</a>';
                }
                if ($slider) {
                    $output .= '<div class="big-preview ' . $blog_style . '">' . $slider . ' </div>';
                }
                //}
                if (!empty($before_content)) {
                    $output .= '<div class="big-preview ' . $blog_style . '">' . $before_content . '</div>';
                }
                $output .= "<div class='entry-content-wrapper clearfix {$post_format}-content'><div class='arrow'></div>";
                $output .= '<header class="entry-content-header">';
                //                if($blog_style == 'grid-mini')
                //                    $output .= modifier_truncate($title,100);
                //                elseif($blog_style == 'grid-small')
                //                    $output .= modifier_truncate($title,20);
                //                else
                $output .= $title;
                if ($instance['post_meta']) {
                    $output .= "<span class='post-meta-infos'>";
                    $markup = schema_markup(array('context' => 'entry_time', 'echo' => false));
                    $output .= "<time class='date-container minor-meta updated' {$markup}><i class='icon-time'></i> " . get_the_time(get_option('date_format')) . "</time>";
                    //$output .= "<span class='text-sep text-sep-date'>/</span>";
                    if (get_comments_number() != "0" || comments_open()) {
                        $output .= "<span class='comment-container minor-meta'><i class='icon-comment'></i> ";
                        $output .= get_comments_popup_link("0 " . __('Comments', 'redux-page-builder'), "1 " . __('Comment', 'redux-page-builder'), "% " . __('Comments', 'redux-page-builder'), 'comments-link', "" . __('Comments Disabled', 'redux-page-builder'));
                        $output .= "</span>";
                        //$output .= "<span class='text-sep text-sep-comment'>/</span>";
                    }
                    $taxonomies = get_object_taxonomies(get_post_type($the_id));
                    $cats = '';
                    $excluded_taxonomies = apply_filters('exclude_taxonomies', array('post_tag', 'post_format'), get_post_type($the_id), $the_id);
                    if (!empty($taxonomies)) {
                        foreach ($taxonomies as $taxonomy) {
                            if (!in_array($taxonomy, $excluded_taxonomies)) {
                                $cats .= get_the_term_list($the_id, $taxonomy, '', ', ', '') . ' ';
                            }
                        }
                    }
                    if (!empty($cats)) {
                        $output .= '<span class="blog-categories minor-meta"><i class="icon-tags"></i> ' . __('in', 'redux-page-builder') . " ";
                        $output .= $cats;
                        $output .= '</span>';
                    }
                    $output .= '<span class="blog-author minor-meta"><i class="icon-user"></i> ' . __('by', 'redux-page-builder') . " ";
                    $output .= '<span class="entry-author-link" ' . schema_markup(array('context' => 'author_name', 'echo' => false)) . '>';
                    $output .= '<span class="vcard author"><span class="fn">';
                    $output .= get_the_author_posts_link();
                    $output .= '</span></span>';
                    $output .= '</span>';
                    $output .= '</span>';
                    $output .= '</span>';
                }
                $output .= '</header>';
                // echo the post content
                $output .= '<div class="entry-content" ' . schema_markup(array('context' => 'entry_content', 'echo' => false)) . '>';
                $output .= $content;
                $output .= '</div>';
                $output .= '<footer class="entry-footer">';
                wp_link_pages(array('before' => '<div class="pagination_split_post">', 'after' => '</div>', 'pagelink' => '<span>%</span>'));
                if (has_tag() && is_single() && !post_password_required()) {
                    $output .= '<span class="blog-tags minor-meta">';
                    the_tags('<strong>' . __('Tags:', 'redux-page-builder') . '</strong><span> ');
                    $output .= '</span></span>';
                }
                $output .= '</footer>';
                $output .= "<div class='post_delimiter'></div>";
                $output .= "</div><div class='clearfix'></div>";
                $output .= "</div></article>";
                $post_loop_count++;
            }
        } else {
            ?>

            <article class="entry">
                <header class="entry-content-header">
                    <h1 class='post-title entry-title'><?php 
            _e('Nothing Found', 'redux-page-builder');
            ?>
</h1>
                </header>

                <p class="entry-content" <?php 
            schema_markup(array('context' => 'entry_content'));
            ?>
><?php 
            _e('Sorry, no posts matched your criteria', 'redux-page-builder');
            ?>
</p>

                <footer class="entry-footer"></footer>
            </article>

        <?php 
        }
        $output .= "<div class='clearfix'></div>";
        if (isset($instance['remove_pagination']) && $instance['remove_pagination'] === false) {
            $output .= "<div class='{$blog_style}'>" . pagination($wp_query, false) . "</div>";
        }
        //$output = ob_get_clean();
        wp_reset_query();
        if ($output) {
            $markup = schema_markup(array('context' => 'blog', 'echo' => false));
            $output = "<div class='{$blog_style} template-blog' {$markup}>{$output}</div>";
        }
        return $output;
    }