Hi Lukas,
there is a shortcode to show the latest "X" posts? [ get_post ] only return the latest one and [ get_post id="ID" ] only a determined ID, but I need the latest in evidence and recent posts aside, in homepage, of course not in footer.
Beside... there is a method to embed a widget in homepage with shortcodes?
Thanks in advance

October 4, 2010, 9:14am

you can get just ONE recent post.

To enable shortcodes in text widget add this line to functions.php:
add_filter('widget_text', 'do_shortcode');

Lukas :-)
October 4, 2010, 11:53am

Ok, so no recent news.
And thanks but I'd glad to know if it was possible to embed widget in shortcode, not the opposite :)
October 4, 2010, 2:06pm


I think that is not possible to embed the widget in shortcode, but if you want to use more that one recent post in columns you can modify source code.

Possible way how to customize recent posts shortcode:
1. Open functions/shortcodes.php and navigate to function get_custom_post()
2. change this snippet $latest_post = get_posts( 'numberposts=1' );
3. wrap rest of code in foreach

You must be little bit skilled coder to do these modifications

Lukas :-)
October 4, 2010, 3:17pm

Ok, we made a new function get_recent_posts from scratch, thanks for no help.
There are two mistyping errors in your code:

if ( $lates_post['0']->post_excerpt ) {
$result .= '

' . $lates_post['0']->post_excerpt . '


that prevents the use of excerpt, need to change $lates_post['0'] with $latest_post['0']
better to correct for a next version.

October 6, 2010, 7:57pm

Hello there
I have same question regarding [get_post] and i've tried solution u provided up there:
$latest_post = get_posts( 'numberposts=1' );
i've changed in
$latest_post = get_posts( 'numberposts=5' );

but still no more than only 1 latest post there... And yes i do have more than 5 :)
What am i missing?
October 7, 2010, 8:36am

Tommorow I create new shortcode for displaying recent postt . Wait for update.
October 7, 2010, 5:50pm

any news on new shortcode?
October 12, 2010, 7:09pm

still waiting :D
October 20, 2010, 9:35pm

i feel stupid to reply to myself here but i DO wonder IF there is any news about this 'new' shortcode ? or shall i just find decent coder myself to solve problem stated in this topic ?
October 27, 2010, 7:09pm

AIT SupportMartin
Sorry for waiting. Lukas will be definitely working on the shortcode, once he'll recover from his flu.
October 28, 2010, 2:09am