Hello
I need Show only one post for day and comments in sidebar, withouth widget.
Can help me?
Hello
I need Show only one post for day and comments in sidebar, withouth widget.
Can help me?
Escuse, i need show post for certain categories in sidebar with the comments on it, or, for extern news I will have the opportunity to add comments in the news.
It's possible?
Hello how i can show one post for selected category in sidebar??
One example (doesn't address your comments):
<?php
//get 5 recent posts in categories 3 or 19. Useful for sidebar or php code widget
$args=array(
'showposts'=>5,
'category__in' => array(3,19),
'caller_get_posts'=>1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo '5 recent Posts';
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
the_content();
endwhile;
} //if ($my_query)
wp_reset_query(); // Restore global post data stomped by the_post().
?>Thanks it work good, but i need show limitated number of characters and if possible add comment number or "Add reply", how i can do it?
1. Replace the_content(); with echo 'this is 40 chars of content >' . substr($post->post_content,0,40);
2. Template_Tags/comments_popup_link
Thanks a lot!!!
This is awesome, thanks!!
This topic has been closed to new replies.