Problem editing widgets.php
-
I’m editing the “Standard Widgets” section of widgets.php, trying to duplicate this piece of code:
<?php
}
function widget_recent_entries($args) {
extract($args);
$title = __('Recent Posts', 'widgets');
$r = new WP_Query('showposts=10');
if ($r->have_posts()) :
?>
<?php echo $before_widget; ?>
<?php echo $before_title . $title . $after_title; ?>
<ul>
<?php while ($r->have_posts()) : $r->the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?> </a></li>
<?php endwhile; ?>
</ul>
<?php echo $after_widget; ?>This is the recent posts widget, I’m trying to duplicate it. However when I copy this and then paste another one below it, I get a parse error. Any idea why?
- The topic ‘Problem editing widgets.php’ is closed to new replies.