echo $subtitle; ?> </span> <?php } ?> </a> </h1> <footer class="entry-meta"> <?php stag_posted_on(); ?> <?php stag_post_reading_time(); ?> <?php edit_post_link(__('Edit', 'stag'), '<span class="edit-link">', '</span>'); ?> </footer> <?php if (stag_theme_mod('post_settings', 'post_categories') && stag_categorized_blog() && $categories_list) { ?> <div class="entry-categories"> <?php _e('In ', 'stag'); echo $categories_list; ?> </div>
/** * Prints HTML with meta information for the current post-date/time and author. */ function stag_posted_on() { $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>'; if (get_the_time('U') !== get_the_modified_time('U')) { $time_string .= '<time class="updated" datetime="%3$s">%4$s</time>'; } $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date())); $author = get_the_author(); if ($author == '') { global $wp_query; $authordata = $GLOBALS['authordata'] = get_userdata($wp_query->post->post_author); $author = $authordata->display_name; } printf(__('<span class="posted-on">%1$s</span><span class="reading-time hide">%3$s</span><span class="byline">por %2$s</span>', 'stag'), sprintf('<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>', esc_url(get_permalink()), esc_attr(get_the_time()), $time_string), sprintf('<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_html($author)), stag_post_reading_time()); }
/** * Widget function. * * @see WP_Widget * @access public * @param array $args * @param array $instance * @return void */ function widget($args, $instance) { if ($this->get_cached_widget($args)) { return; } ob_start(); extract($args); $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); $count = $instance['count']; $post_date = $instance['post_date']; $bg_color = $instance['bg_color']; $bg_opacity = $instance['bg_opacity']; $bg_image = $instance['bg_image']; $text_color = $instance['text_color']; $link_color = $instance['link_color']; $posts = wp_get_recent_posts(array('post_type' => 'post', 'numberposts' => $count, 'post_status' => 'publish'), OBJECT); $posts_page = get_option('page_for_posts'); if ($posts_page == 0) { $posts_page = home_url(); } else { $posts_page = get_permalink($posts_page); } global $post; echo $before_widget; ?> <section class="inner-section"> <span class="hentry" data-bg-color="<?php echo esc_attr($bg_color); ?> " data-bg-image="<?php echo esc_url($bg_image); ?> " data-bg-opacity="<?php echo esc_attr($bg_opacity); ?> " data-text-color="<?php echo esc_attr($text_color); ?> " data-link-color="<?php echo esc_attr($link_color); ?> "></span> <?php if ($title) { echo $before_title . $title . $after_title; } ?> <?php foreach ($posts as $post) { setup_postdata($post); ?> <article id="post-<?php the_ID(); ?> "> <header class="entry-header"> <h1 class="entry-title"><a href="<?php the_permalink(); ?> " rel="bookmark"><?php the_title(); ?> </a></h1> </header><!-- .entry-header --> <footer class="entry-meta"> <?php stag_posted_on(); ?> <?php stag_post_reading_time(); ?> <?php edit_post_link(__('Edit', 'stag'), '<span class="edit-link">', '</span>'); ?> </footer><!-- .entry-meta --> </article> <?php } ?> <?php wp_reset_postdata(); ?> <a href="<?php echo $posts_page; ?> " class="button all-posts"><?php _e('See All Posts', 'stag'); ?> </a> </section> <?php echo $after_widget; $content = ob_get_clean(); echo $content; $this->cache_widget($args, $content); }