There's this "Recent Posts" widget, that should output only posts in category 'News' (ID 26)
So I tried this:
<?php $t =& peTheme(); ?>
<?php $content =& $t->content; ?>
<?php list($data) = $t->template->data(); ?>
<?php if (in_category('26')):?> <!-- Line I added -->
<?php if (!empty($data->title)): ?>
<h3><?php echo $data->title; ?></h3>
<?php endif; ?>
<?php while ($content->looping()): ?>
<span class="small"><?php $content->date(); ?></span>
<a class="comments-num small" href="#"><?php $content->comments(); ?></a>
<p><?php echo $t->utils->truncateString(get_the_excerpt(),$data->chars); ?>
<?php endwhile; ?>
<?php if (!empty($data->link)): ?>
<a class="more-link" href="<?php echo $data->url ?>"><?php echo $data->link ?></a>
<?php endif; ?>
<?php endif; ?> <!-- Line I added -->
But it outputs a blank space where it was the widget. Is there a way I can filter to only show recent posts from category 26 there?
peTheme()
is not a WordPress function. Since most people viewing this will not know what it does or what it returns, this code is not complete.