• Resolved benhartwich

    (@yoursql719)


    Hi,

    currently I′m testing to insert your template code at a theme, and I know, that you can′t give me support for the theme. But it seems that the shortcode
    <?php echo do_shortcode('[KGVID]'); ?> isn′t initated, because the div where it′s placed is empty.

    Is there any possibility to init the shortcode at functions.php? Can you please give me a hint for testing and developing? Have I to initiate the kgvid anywhere or what is needed to run the shortcode?

    Best,

    https://www.ads-software.com/plugins/video-embed-thumbnail-generator/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Kyle Gilman

    (@kylegilman)

    There’s no initializing to do. As long as there is at least one video attached to the post you’re testing with, then it will work. When the shortcode doesn’t output anything it’s almost always because the shortcode doesn’t have any videos to work with. First verify that the post you’re working with has a video attached to it. It’s also a good idea to verify that your template runs both wp_head() and wp_footer() which output necessary scripts and CSS to make the video players run. Try putting the shortcode in the post content as a test. If it’s not outputting anything from there either, then you know it’s not because of a problem with the template editing.

    Thread Starter benhartwich

    (@yoursql719)

    Yes you′re right, it′s a theme issue. The code is working at the same article in twentyfifteen for example. The theme itself runs this code I think, but it′s not set at this single file. I will try to set both at this file. It′s curious: there a few files at the theme, where the shortcode runs, but not at the file headers-single-video.php. Is there a limitation, that a shortcode from a plugin can only run at typical called theme files?

    Could you provide the code for your plugin, which could be set at the functions.php?

    Plugin Author Kyle Gilman

    (@kylegilman)

    There is no code you could put in your functions.php file that will solve your problem. It is not surprising at all that you can’t get the code to run in the header section of a template file. The code must be run within the Loop, otherwise the plugin has no idea what post you’re dealing with and won’t be able to find any videos attached to that post in order to display them.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Init template shortcode’ is closed to new replies.