Support » Plugin: Embed PDF » Embed PDF using do_shortcode()

  • Resolved adopted3

    (@adopted3)


    Hello: I have “Embed PDF” version 1.04.

    the [embed]...[/embed] shortcode works fine on a page. But when I use do_shortcode within PHP code on a template page, the plugin doesn’t bring up the PDF viewer. Here’s how I’m using it:


    <?php
    echo do_shortcode('[embed]'.'http://example.com/example.pdf'.'[/embed]');
    ?>

    Thanks!
    Paul

    http://wordpress.org/extend/plugins/dirtysuds-embed-pdf/

Viewing 3 replies - 1 through 3 (of 3 total)
  • fyi… i found that this code works:


    <?php
    global $wp_embed;
    $post_embed = $wp_embed->run_shortcode('[embed]http://example.com/example.pdf[/embed]');
    echo $post_embed;
    ?>

    not sure why do_shortcode didn’t work.

    Plugin Author Pat Hawks

    (@pathawks)

    I agree, it’s odd that do_shortcode wasn’t working for you.
    Glad you found something that did work, though.

    Yeah, do_shortcode won’t work for me either.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Embed PDF using do_shortcode()’ is closed to new replies.