[wp-trac] [WordPress Trac] #16385: Catchable fatal error in WP 3.1 RC3 - echo get_category_link

WordPress Trac wp-trac at lists.automattic.com
Sun Jan 30 19:15:19 UTC 2011


#16385: Catchable fatal error in WP 3.1 RC3 - echo get_category_link
---------------------------------------------------+-----------------------
 Reporter:  vasylesku                              |       Owner:
     Type:  defect (bug)                           |      Status:  reopened
 Priority:  normal                                 |   Milestone:  3.1
Component:  General                                |     Version:  3.1
 Severity:  normal                                 |  Resolution:
 Keywords:  reporter-feedback needs-investigating  |
---------------------------------------------------+-----------------------

Comment (by vasylesku):

 The permalinks is set to /%category%/%postname%/. Anyway, I just upgraded
 to 3.1 from 3.0.4. I installed another wp 3.1 in my wamp and... the same
 results.
 Another example:

 ''                      <div class="hpfeatured">
                         <h3><?php echo
 cat_id_to_name(get_theme_mod('featured_top_right')); ?></h3>

                                 <?php $recent = new
 WP_Query("cat=".get_theme_mod('featured_top_right')."&showposts=".get_theme_mod('featured_top_right_num'));
 while($recent->have_posts()) : $recent->the_post();?>
                                 <?php if( get_post_meta($post->ID,
 "thumb", true) ): ?>
                                 <a href="<?php the_permalink() ?>"
 rel="bookmark"><img class="thumb" src="<?php
 bloginfo('template_directory'); ?>/tools/timthumb.php?src=<?php echo
 get_post_meta($post->ID, "thumb", $single = true); ?>&amp;h=<?php echo
 get_theme_mod('featured_top_right_thumb_height'); ?>&amp;w=<?php echo
 get_theme_mod('featured_top_right_thumb_width'); ?>&amp;zc=1" alt="<?php
 the_title(); ?>" /></a>
                                 <?php else: ?>
                                 <?php endif; ?>

                                 <strong><a href="<?php the_permalink() ?>"
 rel="bookmark"><?php the_title(); ?></a></strong>
                                 <?php the_content_limit(80, ""); ?>

                                 <hr/>

                                 <?php endwhile; ?>
                                 <?php $cat =
 get_category(get_theme_mod('featured_top_right')); ?>
 '''Line 40''':                          <strong><a href="<?php echo
 get_category_link(get_theme_mod('featured_top_right')); ?>"
 rel="bookmark"><?php echo __("Read More Posts From ", 'studiopress')."
 ".$cat->name; ?></a></strong>

                         </div>

                 </div>''

 Results: "Catchable fatal error: Object of class WP_Error could not be
 converted to string in C:\wamp\www\wordpress\wp-
 content\themes\church\home.php on line 40"

 Try the Church theme from Studio Press and Fashion Pro from Theme Junkie!

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16385#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list