0
I have this code and when I put it on the Home Page it returns the entire post. I need you to return only the title, date and thumbmail of the post, is recovering all content of the post...
function get_mais_lidos_semana() {
global $wpdb;
global $post;
ob_start();
$week = date('W');
$year = date('Y');
query_posts('post_type=post&posts_per_page=5&meta_key=post_views_count&orderby=meta_value_num&ignore_sticky_posts=1&year=' . $year . '&w=' . $week);
$text = '<div class="td_block_inner">';
while (have_posts()):
the_post();
$text .= '
<div class="td-block-span12">
<div class="td_module_6 td_module_wrap td-animation-stack">
<div class="td-module-thumb">
<a href="'.get_the_permalink().'" title="'.get_the_title().'" rel="bookmark">
'.get_the_post_thumbnail().'
</a>
</div>
<div class="item-details">
<h3 class="entry-title td-module-title">
<a href="'.get_the_permalink().'" title="'.get_the_title().'" rel="bookmark">
'.get_the_title().'
</a>
</h3>
<div class="td-module-meta-info">
<span class="td-post-date">
<time class="entry-date updated td-module-date">
'.get_the_date().'
</time>
</span>
</div>
</div>
</div>
</div>
';
endwhile;
$text .= '</div>';
wp_reset_query();
echo $text;
}
tries to remove this part: "the_post();"
– Victor M.