Ticket #7547 (closed defect: fixed)

Opened 3 months ago

Last modified 3 months ago

Filter news on templates cant work

Reported by: tandilboy Assigned to: anonymous
Priority: high Milestone: 2.6.2
Component: General Version: 2.6.1
Severity: blocker Keywords:
Cc:

Description

i using a code to filter news on sidebar. on 2.5 series works well, but in 2.6.1 cant works. any fix? heres is the template code

 <table cellpadding="0" cellspacing="0" id="AutoNumber44" >
    <tr>
      <td style="width: 519px; text-align: left; background-color: #e3e3e3; border-width: thin; vertical-align: bottom;">
 <?php
 global $post;
 $myposts = get_posts('numberposts=1&offset=0&category=24');
 foreach($myposts as $post) :
 setup_postdata($post);
 ?>
    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/alerta.gif" alt="Destacada" /><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
 <?php endforeach; ?>
</td>
	</tr>
</table>

Change History

08/19/08 13:15:24 changed by tandilboy

08/19/08 21:30:13 changed by ryan

If get_posts() isn't returning a post then it is probably the same as #7326. I haven't been able to reproduce these problems, unfortunately. I cut-and-paste your code into my sidebar and it works fine. Can you try the debugging steps mentioned here:

http://trac.wordpress.org/ticket/7326#comment:20

08/28/08 22:30:28 changed by ryan

(In [8766]) Suppress query filters when called from get_posts(). see #7326 #7547

09/01/08 17:02:40 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

[8795] for 2.6 branch