shortcode displaying where it pleases not where it is put
-
I created a VERY simple little shortcode so far using the codex example as I’m trying to create it more elegantly but have hit one serious problem. The damn thing just won’t show up where I place it. Instead of rendering inside the post content wrapper, it displays above it. Every time, no matter the post.
Heres what I got
in functions PHP:function wptuts_recentposts($atts, $content = null){ $recent_posts = wp_get_recent_posts(); foreach( $recent_posts as $recent ){ echo ' <li><a>' . $recent["post_title"].'</a> </li> '; } } add_shortcode('recent_posts', 'wptuts_recentposts');
in content area in page editor:
[recent_posts]
anybody got a clue in heck what could be going on? I’m using a template called Karma for this site.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘shortcode displaying where it pleases not where it is put’ is closed to new replies.