yizhan 0 Report post Posted May 25, 2010 need help, i tried to put a featured post on the feature box, thumbnails and titles are ok but the excerpt filter only affects the first post and another one is the fullwidth widgets appears when i added those code in the function.php i think there something wrong with the codes Share this post Link to post Share on other sites
cmunns 16 Report post Posted May 25, 2010 Are you using shortcodes? How are you entering that data into the feature boxes? Share this post Link to post Share on other sites
yizhan 0 Report post Posted May 26, 2010 yes i'm using shortcodes. datas are entered as "[shortcode]" i think theres something wrong with my function.php cause it happened when i entered functions in my function.php any advise? Share this post Link to post Share on other sites
bryan-hadaway 3 Report post Posted May 26, 2010 Well, you might temporarily remove the added functions to pinpoint for sure that is the problem. Then put them back one by one, I would say put them below all other code. What are the added functions purpose, perhaps I can come up with a work around for what you're trying to accomplish with the added functions. Thanks, Bryan Share this post Link to post Share on other sites
yizhan 0 Report post Posted May 26, 2010 ok thanks, i have no more problem with the fullwidth widget issue.. the only problem i got is adding the excerpt here is the original code that i got from other post function recentposts($atts, $content = null) { extract(shortcode_atts(array( "num" => '5', "cat" => '' ), $atts)); global $post; $myposts = get_posts('numberposts='.$num.'&offset=0'); foreach($myposts as $post) : setup_postdata($post); echo "<li class="list-item fix">n"; if(has_post_thumbnail()): the_post_thumbnail(array( 45, 45 ),array( 'class' => 'list_thumb list-thumb' )); else: echo "n"; endif; echo "<div class="list_item_text">n"; echo '<a class="list_text_link" href="';the_permalink(); echo '"'; echo ' <span class="list-title">'; echo $post->post_title; echo '</span>'; echo '<small><p><span class="list-describe">'; the_time(get_option('date_format')); echo ' | Komentarze (';comments_number(0, 1, '%'); echo ')</span></p></small></div>'; endforeach; } add_shortcode("recent", "recentposts"); and i want to add the excert, any idea? Share this post Link to post Share on other sites
yizhan 0 Report post Posted May 26, 2010 i've tried to insert "the_excerpt();" and the filter for "read the rest." but its seem to show only in the first post. Share this post Link to post Share on other sites
Andrew 207 Report post Posted May 26, 2010 In the code you're using, don't use the variable $post. It is used by everything to control normal behavior (e.g. the full width sidebar showing) Switch out '$post' for '$myrecentposts' or something like that. Share this post Link to post Share on other sites
yizhan 0 Report post Posted May 26, 2010 A big THANKS!!! it works...... your great guys.... Share this post Link to post Share on other sites
yizhan 0 Report post Posted May 27, 2010 i notice one more problem, when i cange '$post' to 'myrecentpost' everything looks fine but the permalink is gone it always go to the home page. Share this post Link to post Share on other sites
cmunns 16 Report post Posted May 27, 2010 I do not see a closing link tag in the code above. Was the permalink showing before? Share this post Link to post Share on other sites
yizhan 0 Report post Posted May 28, 2010 yap the permalink is showing when i'm using the '$post" variable but when i change that to something else all permalink are directed to the home page. Share this post Link to post Share on other sites
bryan-hadaway 3 Report post Posted May 28, 2010 Try places a } at the very bottom of your code. Thanks, Bryan Share this post Link to post Share on other sites