I want to use WP Ui tab in header.php instead of any pages or post.in pages i can add like this:-
[wptabs mode="horizontal"] [wptabtitle] Map[/wptabtitle] [wptabcontent]map detail[/contentment][wptabtitle] Get Bids[/wptabtitle] [wptabcontent]bid detail[/wptabcontent] [/wptabs]
thanks in advance
<?php echo do_shortcode('[wptabs mode="horizontal"] [wptabtitle][/wptabtitle] [wptabcontent][/contentment][wptabtitle][/wptabtitle] [wptabcontent][/wptabcontent] [/wptabs]'); ?>
You can use the do_shortcode function of wordpress for this purpose.. e-g add the above function in your header.php . If you are not programmer then i suggest you to take help from some professional developer.
Related
In my current WordPress theme, i have some 5 widgets.
I tried with plugins available on internet but that not solved my problem.
I want to use more widgets in my theme in single sidebar.
How can i add more widgets in WP theme?
Thanks
Most widgets give you a shortcode to put into one of the pages that wil be echoed out through the the_content(); function.
So if you would like to process those shortcodes in the PHP to make them in custom places would probably be your best bet.
You can do that like this:
<?php echo do_shortcode( $content ) ?>
Here is the reference
I need help with wordpress shortcode. I have written shortcode function in functions.php in my theme files. Now I create page in wordpress administration and then I need to place this shortcode into special place in my theme but with content which I wrote in administration.
I hope that you understand what I mean.
Thank you for your help.
In your template code:
<?php echo do_shortcode('[your-shortcode]'); ?>
Replace [your-shortcode] with whatever your shortcode is, including parameters/attributes and/or closing tags if required.
http://wordpress.org/extend/plugins/baw-post-views-count/screenshots/
i'm installed and active "Post Views Count" plugin but when i'm use shortcode [post_view] like this, it's doesn't woek....
<li><em>[most_view]</em></li>
OR:
<li><em><?php [most_view] ?></em></li>
[most_view] is short code and must place in post content if you want to put post counts in your template use this:
<?php bawpvc_views_sc(); ?>
Did you activate the plugin?
[most_view] must be placed in a post or page via the text-editor of the admin. Looks like you are making a template?
If you would like to use shortcodes in your PHP code, you should check the Wordpress' do_shortcode() function: https://developer.wordpress.org/reference/functions/do_shortcode/
Example using the shortcode you provided:
<li><em><?php echo do_shortcode( '[most_view]' ); ?></em></li>
I'm very new to this PHP coding.. actually I'm not a programmer, but I need this help from anyone here...
Anyway, what I need help from you:
I have written a small snippet of Custom Page template, here it is:
------------------------------
<?php
/*
Template Name: MyCustomTemplate
*/
?>
<?php get_header(); ?>
<?php get_footer(); ?>
------------------------------
Now I have installed a wordpress slider plugin "Nivo Slider"..
Now I'm not understanding how do I call this plugin into my custom template...
Iam trying to achive home page with a Slider and some ads in it.. eg: I need my home page like this: www.papayaclothing.com/shop/
So, could anyone please provide me a code to work that?
Please try following code, make sure that slider you are trying to call is published:
<?php
//valid for Nivo Slider version < 1.8
echo do_shortcode('[nivoslider slug="my-slider"]');
?>
Let me know if my answer was helpful.
I develop a new theme for wordpress 3.3.1 from scratch and shortcodes are not working on it.
As I searched until now it is a matter of filtering the content containing the shortcode, filter code added in a theme specific location(shorcodes are working with another theme).
So, my question is : What is the code for a general shortcode theme enable ?
To execute a single shortcode, run it with
echo do_shortcode('[your_short_code]');
If the shortcode(s) are in the post content, make sure you're displaying it with
<?php the_content();?>
Or
<?php echo apply_filters('the_content',$post_content);?>
Or
<?php echo apply_filters('the_content',$wp_query->post->post_content);?>
The important thing is: if you aren't using the function "the_content()" you need this line <?php echo apply_filters('the_content',$wp_query->post->post_content);?> where in the second argument you have to put the variable of the post content you want to show.
I had to save the theme's content to a variable and then use the second example.. Worked like a charm.
$mycontent = ot_get_option('rightcontent');
echo apply_filters('the_content',$mycontent);