Support » Plugins » [Plugin: Google Doc Embedder] embed it in the codex

  • Resolved mm88


    Hi, the syntax to put the GVIEW plugin into a page is: [gview file=””]

    but what is the (PHP/WP) syntax to put it in a .php page (attachment.php for ex.) in editing mode?

    a good alternative to GVIEW and editing flexible exists?


Viewing 7 replies - 1 through 7 (of 7 total)
  • Try the following:

    <?php echo do_shortcode('[gview file=""]'); ?>

    Let me know if this does or doesn’t work, as I’ve not done this in a while.

    thanks k3davis, it works!!! But now I have a problem passing the path variable.


    <?php $filepdf = wp_get_attachment_url($post->ID);
    echo do_shortcode('[gview file="."$filepdf"."]'); ?>

    it dosen’t work.

    thanks again

    I’m not sure just what you’re doing there, so I’m not sure how much help I can be. What does not work when you do it this way, for starters? Does the viewer load but the document doesn’t display? Does nothing display at all (check the page source for “GDE” to see if any error is found there)?

    It Does nothing display at all, because there’s an error in my php code syntax. The problem is displaying the $filepdf variable in the function echo.

    I don’t know the correct syntax.


    I’m still not sure exactly what you’re trying to do, but you can try this:

    <?php $filepdf = wp_get_attachment_url($post->ID);
    echo do_shortcode('[gview file="'.$filepdf.'"]'); ?>

    It may just be a quotes problem, but then again I’ve never tried to pass a variable using the do_shortcode function, so I’m not sure if this is supported or not.

    yes, it was a quotes problem: Now it works!

    many thanks k3davis!

    Glad it worked out. 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Google Doc Embedder] embed it in the codex’ is closed to new replies.