Support » Plugins » Hacks » Shortcodes on pages

  • Hi,

    I’m developing a plugin for wordpress and I’m trying to use shortcodes to add content to posts and pages. I added a shortcode handler for it like this:

    function foobar_shortcode($attr) {
    include($pluginpath . ‘foobar.php’);
    $ret = ob_get_contents();
    return $ret;
    add_action(‘foobar’, ‘foobar_shortcode’);

    Now [foobar] works on posts, but not on pages. So how can I get shortcodes to work also on pages?

  • The topic ‘Shortcodes on pages’ is closed to new replies.