How to show Recent articles in sidebar 1

ata.online

New Member
Messages
159
Reaction score
0
Points
0
Since yesterday, i have been trying to embed html code so that 'Recent Articles' is shown in sidebar 1:
http://www.ataarticles.com/

I referred to the sidebar html code shown at:
http://articlesss.com/article-directory-wordpress-theme/

but no joy there. Everytime i try to include it in sidebar 1, all the content disappears. I know there is a small code which is missing but not sure what it is exactly: When i try to embed the below code it does not show up at all.

<?php } ?>
</ul>
</div>
<?php } ?>

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar 1') ) : ?>
<h2>Recent Articles</h2>
<?php
$myposts = get_posts('numberposts=5');
foreach($myposts as $post) : setup_postdata($post);
?>
<div class="post">
<h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<div class="postmetadata"><?php the_time('m.d.y') ?> @ <?php the_category(', ') ?></div>
<div class="entry">
<?php the_excerpt(); ?>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>

</div><!-- end #l-sidebar -->
 

cheezo

Member
Messages
177
Reaction score
0
Points
16
this is wordpress turned into a directory right?
go to the dashboard as click widgets under the appearance and then select recent post. drag it to the sidebar. :D
 

ata.online

New Member
Messages
159
Reaction score
0
Points
0
this is wordpress turned into a directory right?
go to the dashboard as click widgets under the appearance and then select recent post. drag it to the sidebar. :D

If only it was that easy. There is no widgets related to that. There is one 'Recent Articles' widgets which i just added to sidebar 1 yesterday. But the main recent articles seems to be linked under sidebar.php and not the widgets. I tried to bring it sidebar 1 in sidebar.php but didn't work.

thanks.
 

cheezo

Member
Messages
177
Reaction score
0
Points
16
see if there is recent posts. :D
i'm sure wordpress has it.
 
Top