Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#7547 closed defect (bug) (fixed)

Filter news on templates cant work

Reported by: tandilboy's profile tandilboy Owned by:
Milestone: 2.6.2 Priority: high
Severity: blocker Version: 2.6.1
Component: General Keywords:
Focuses: Cc:


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

Change History (4)

#2 @ryan
16 years ago

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:

#3 @ryan
16 years ago

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

#4 @ryan
16 years ago

  • Resolution set to fixed
  • Status changed from new to closed

[8795] for 2.6 branch

Note: See TracTickets for help on using tickets.