Tips and Tricks HQ Support Portal › Forums › WP Lightbox Ultimate › Short Codes do not work on Page
Tagged: PHP Template, short code
- This topic has 10 replies, 4 voices, and was last updated 13 years, 2 months ago by admin.
-
AuthorPosts
-
September 12, 2011 at 9:34 am #4287jian4guo2Member
I have just purchased the plugin and wanted to place a vimeo video on one of my page templates (not a post). I used the short code for the post insert but that does not work on a page. I cannot find instruction for using the plugin on a wordpress page. How do you do this?
September 12, 2011 at 12:25 pm #36509wpCommerceModeratorCan you please post a link to that page where you are using the shortcode?
What shortcode are you exactly using?
Please check the “Plugin Usage” section of the following page for instruction –
September 12, 2011 at 1:42 pm #36510wzpModeratorI don’t think short codes work in template files; you’d have to use PHP code.
September 12, 2011 at 10:47 pm #36511jian4guo2MemberI am using the following short code on a template page just as a test. I followed all the instructions via the link above (though no instructions are given for adding the code to a template page). It still doesn’t work.
[wp_lightbox_colorbox_anchor_text_video link=”http://player.vimeo.com/video/8245346″ title=”Video title goes here” text=”Click here to open the Vimeo video “]
September 12, 2011 at 11:00 pm #36512wzpModeratorWhen you use the term “template page,” are you referring to a theme file that has “.php” at the end of its name?
September 12, 2011 at 11:57 pm #36513jian4guo2MemberYes. I created a template page. This is the beginning of the code (i disabled php here for viewing):
<?*php
/*
Template Name: Special Coverage
*/
?*>
<?*php get_header(); ?*>
<div class=”wrapper”>
<div id=”small_video”>
<div class=”short” style=”border-top:none;”>
<h1><span class=”video”>VIDEO</span> Going Out West</h1>
[wp_lightbox_colorbox_anchor_text_video link=”http://player.vimeo.com/video/8245346″ title=”Video title goes here” text=”Click here to open the Vimeo video “]
…..
September 13, 2011 at 12:04 am #36514wzpModeratorShort codes do not work on template pages.
September 13, 2011 at 1:13 am #36515wpCommerceModeratorYou need to use the “do_shortcode” filter of wordpress to be able to use shortcode on a php file.
http://codex.wordpress.org/Function_Reference/do_shortcode
Please use the shortcode in the following format:
<?php echo do_shortcode(‘[wp_lightbox_colorbox_anchor_text_video link=”http://player.vimeo.com/video/8245346″ title=”Video title goes here” text=”Click here to open the Vimeo video”]’);
?>
September 13, 2011 at 5:27 am #36516jian4guo2Memberthat worked! thanks a lot!
September 14, 2011 at 10:01 am #36517jian4guo2MemberGrief! The <?php echo do_shortcode… above worked great until I upgraded WordPress to 3.2.1 Now it stopped working again. Is the plugin not compatible with the latest version of WP?
This is getting frustrating.
September 14, 2011 at 10:56 pm #36518adminKeymasterAll of our plugins are kept upto date to work with the latest build of WordPress so the WordPress version is not the issue. Please provide the following two details so we can check and see what is wrong on your site:
1) A link to the page where you are using the shortcode (where I can go and click on the anchor)
2) A screenshot showing the PHP code that you placed in your template.
-
AuthorPosts
- You must be logged in to reply to this topic.