0

Is it possible to call shortcode outside of post/ page content area? I am trying to add it to wp_footer with the following codes but it's returning string:

add_shortcode('eps_pop', 'init');
function indtable_display_front_end($atts ) {
global $post;

    extract( shortcode_atts( array(
    'id' => ''  
    ),  $atts ) );

echo get_post_meta($id, '_my_meta_value_key', true);
}
echo do_shortcode('[eps_pop id="234"]');
1

Try this:

add_shortcode('eps_pop', 'indtable_display_front_end');
function indtable_display_front_end($atts ) {
global $post;

    extract( shortcode_atts( array(
    'id' => ''  
    ),  $atts ) );

echo get_post_meta($id, '_my_meta_value_key', true);
}
echo do_shortcode('[eps_pop id="234"]');
| improve this answer | |
  • Ohhh... my God.. I forgot to change that function name.. Thanks Dude..! – Ari Jun 15 '14 at 7:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.