Search Results for 'do_shortcode'

    No search results were found in Documentation!

Results from the Forum
Emil G
tagDiv Staff

Hi,

Try the following code – http://screencast.com/t/FR7ALJVvZ9Q

<div class="td-container">
    <div class="td-container-border">
        <div class="td-pb-row">
            <?php echo do_shortcode('[vc_row][vc_column width="1/1"][td_block_trending_now limit="5"][/vc_column][/vc_row]');?>
        </div>
    </div>
</div>

Result – http://screencast.com/t/QGjlSFMaTTgY

Thank you, Emil G.

  • This reply was modified 11 years by Emil G.
Marius
tagDiv Staff

Hi,

Do you want only on article pages? or on entire site?

This is for entire site:

Add this code: echo '<div class="container td-header-custom">' . do_shortcode('[td_ad_box spot_id="custom_ad_1"]') . '</div>'; like here: http://screencast.com/t/fBMwoay2

Add your add code in Custom ad 1 in Theme panel.

Then add this css in Theme Panel -> Custom CSS

.td-header-custom {
.td-g-rec {
margin-bottom: 0px;
margin-top: 30px;
}
}

Result: http://screencast.com/t/FkAewBNgWE
If not perfectly aligned on some pages you need to adjust it via CSS

Lucian
tagDiv Staff

Hi,

Unfortunately you can’t customize the attachment template using the page builder but you could edit the attachment template file (attachment.php) and customize your attachment page as you like.
For ex. I have used the do_shortcode() to add an gallery to the page, like this: http://screencast.com/t/RjuYUQIfLm3
This is the code I have used: <?php echo do_shortcode('add your shortcode here') ?>
You can also add css into the custom css filed in theme panel and use the .attachment class to target the attachment template.
Hope this helps!

Thanks

  • This reply was modified 11 years by Lucian.
Lucian
tagDiv Staff

Hi,

You can edit the header file the the search for the header style you have: http://screencast.com/t/QrpM1sb7xg You can then use the shortcode function to add your content directly into header file.
You can find more info abut how you can add content using the do_shortcode function here: https://forum.tagdiv.com/topic/a-few-questions/#post-29762
Please note that this is nopt easy and the block haven;t been desinged to work on header and if you don’t have basic html/css/php knowledge and don’t know how to do it we suggest you hire a developer to do it for you as unfortunately we cannot offer custom work as we work hard on the development, updates, fixes and support. You can always get a freelancer from sites like: http://studio.envato.com/ if you don’t know how to do it yourself.
Hope this helps!

Thanks

  • This reply was modified 11 years by Lucian.
Lucian
tagDiv Staff

Hi,

You could use the shortcode function to do it and add your content directly into post’s template file, like this: http://screencast.com/t/WQAlNNPrz
You can build a block with visual composer then switch to classic mode then add it to the template using the same method like for the custom ads above:
do_shortcode('your block shortcode here'); ?>
You can more info related what you would have to do it here: https://forum.tagdiv.com/topic/a-few-questions/
Hope this helps!

Thanks

Lucian
tagDiv Staff

Hi,

Unfortunately the related posts function can be used just on posts page template.
You could use the shortcode function though and build a block with visual composer then switch to classic mode then add it to the template using the same method like for the custom ads above:
do_shortcode('your block shortcode here'); ?>
You can more info related what you would have to do it here: https://forum.tagdiv.com/topic/a-few-questions/
Hope this helps!

Thanks

Lucian
tagDiv Staff

Hi,

You could do it but you will have to add them hard coded as unfortunately the theme doesn’t have an option for that.
Here are the theme’s header files located: http://screencast.com/t/kyTBlUnRoo ..edit the one you use and you can use the do_shortcode() function to add your widgets using shortcodes and build them via Visual Composer, here is an example of how you can build and implement a shortcode into a template: https://forum.tagdiv.com/topic/how-to-add-custom-widget-below-post/#post-30389
Hope this helps!

Thanks

Lucian
tagDiv Staff

Hi,

Unfortunately the theme doesn’t have an filter option so that you can filter posts by ID.
If you only want one post on a specific block you can do it by adding that one post into an new category then use the filter by category and chose that category which will display just that one post.
If you also need more posts like this on other block you can use the same category and also set the limit to 1 post and use offset to jump trough posts and display just the one you want into that block.
You can remove the related articles form panel and add using the do_shortcode() function a block customized with visual composer as you like.

Thanks

Lucian
tagDiv Staff

Hi,

Thanks Christopher unfortunately you are right, as changing the content’s width would break the layout so it is not recommended so the only way to have a wide ad there is to set the page to full width, without sidebar or edit the post template files and add it directly there using the do_shortcode function and the shortcode for the ad box.
I will also add this on our feature request list and consider it for future updates.

Thanks

Lucian
tagDiv Staff

Hi,

You can use the do_shortcode() function and use the shortcodes generated by the Visual Composer plugin to customize the widgets/blocks you want to add into the template and then add it where you want it like this: http://screencast.com/t/xJbuxE9n
Hope this helps!

Thanks

gouravgola
tagDiv Member

@lucian thanks for responding, can you please elaborate this process?
as far from your above point, i understood these things:
1. go to setting>visual composer> myshort codes ? is it how to generate short codes? but what should i add there to generate code there? i want to add content.ad widget php code.

2. then add <?php echo do_shortcode(‘[]’);?> to loop-single.php like this:
<?php echo $td_mod_single->get_social_sharing_bottom();?>
<?php echo $td_mod_single->get_next_prev_posts();?>
<?php echo do_shortcode(‘[]’);?>
<?php echo $td_mod_single->get_author_box();?>
<?php echo $td_mod_single->get_item_scope_meta();?>
</footer>

as i want my widget to show up just below nest prev navigation?

is this the way you are saying?
if yes then please tell me how to generate short codes and how to use them in details, that would be really great help for those who are new to wordpress!

thank you!

Lucian
tagDiv Staff

Hi,

You can use the do_shortcode() function and use the shortcodes generated by the Visual Composer plugin to customize the widgets/blocks you want to add into the template and then add it where you want it like this: http://screencast.com/t/Y3TQLaFOx3lP
Hope this helps!

Thanks

Lucian
tagDiv Staff

Hi,

!. You can use the do_shortcode() function and add the shortcode for the news ticker directly into the post template, like this:

First go to VC page builder and customize the ticker then switch to classic mode and get the ticker shortcode: http://screencast.com/t/04wufgypnN1I and add it to the loop-single.php file like this: http://screencast.com/t/1KuOePag
Result: http://screencast.com/t/IHXIudCMfY9k
For changing the “Trending Now” title you can use the translation panel and change it like this: http://screencast.com/t/NQuwThYX or hard coded, like this: http://screencast.com/t/4RBappdbLltH

2. You can disable the sharing and like/tweet buttons from theme panel: http://screencast.com/t/wsaMNsoa7ct then add you own using shorcodes or other method and place them into the post template replacing the buttons: http://screencast.com/t/HjUfJerVcW

3. From theme panel > post settings, like this: http://screencast.com/t/uaZi1AjF0a
4. Use this custom css in theme panel > custom css field:

.td-scroll-up {
display: none;
}

Thanks

jb
tagDiv Member

I have added this code <?php echo do_shortcode('[td_ad_box spot_id="custom_ad_1"]'); ?> below <div class="td-ss-main-content"> at page.php. Now the add looks great on all pages, but where should I add the shortcode for the other sites (tags, categories…)?

And where should I add the code at single posts? I have tested it with “Article top ad”, but with this option the ad will displayed below the “featured image”. For “Style 1” (little thumbnail) is this option ugly and I want it direct below the menu.

It would be a very cool feature when there are some hooks so it is possible to add ads via function.php. So I have to change every template-site with every update…

Guideduchien
Participant
#0

Hi,

I tried to put a custom ad with adrotate shortcode wich works fine with bottom ad in responsive but doesn’t work with custom ad shortcode on php.

I want that the custom ad 1 with adrotate displays only on phones, i put this code in the loop single file but the ad displays on dekstop too while i deseabled it :

<?php echo do_shortcode(‘[td_ad_box spot_id=”custom_ad_1″]’); ?>

Thank you for your help and sorry for my bad english

Lucian
tagDiv Staff

Hi,

You can use the do_shortcodes() function on the ad and use this shortcode [td_ad_box spot_id="custom_ad_1"].
Just add this line in the category template and the ad code in custom ad box 1 in theme panel > ads, like this: http://screencast.com/t/CR8amKUUbfK

do_shortcode('[td_ad_box spot_id="custom_ad_1"]'); ?>
Result: http://screencast.com/t/TvB6MADK

The article bottom add is already set to be displayed after the content just add your adsense ad code here: http://screencast.com/t/6JOl2Hnl7lN

Thanks

Lucian
tagDiv Staff

Hi,

The bottom article ad it’s set to be displayed at the end of the content of each post, to modify this you would have to hack the get_content() function: http://screencast.com/t/gcXWtR3tMB3
You could also disable the bottom ad and use the custom ad box to display your ad where you like in the post template using the do_shortcode() function to add the custom ad to your template after the author box, like this: http://screencast.com/t/suTlcZo6fKX
Use this line: do_shortcode('[td_ad_box spot_id="custom_ad_1"]'); ?> edit and add it in the post template you want.
Result: http://screencast.com/t/m06OclikYgA6
Use this css to add a margin at the top:

.td-a-rec-id-custom_ad_1 {
margin-top: 50px;
}

Thanks

Lucian
tagDiv Staff

Hi,

Yes, you can use the do_shortcodes() function on the ad and use this shortcode [td_ad_box spot_id="custom_ad_1"].
Just add this line in your template and the ad code in custom ad box 1 in theme panel > ads.

do_shortcode('[td_ad_box spot_id="custom_ad_1"]'); ?>

Thanks

mehedi
tagDiv Member

@Thakksy It wasn’t playing well with the theme when its automatically added. Add the following code the post templates to display it:

<?php echo do_shortcode('[sharify]'); ?>

Hope that helps 🙂

Lucian
tagDiv Staff

Hi,

Thanks Christopher!

@jalmz
Place the do_shortcode function like this: http://screencast.com/t/8umZbVsCN5

Thanks

jalmz
tagDiv Member

Yes but i want it after the tags..

In loop-single.php
<?php echo $td_mod_single->get_source_and_via();?>
<?php echo do_shortcode('[ultimatesocial networks="total,facebook,twitter,mail"
custom_class="my-ultimatesocial-class"]'); ?>
<?php echo $td_mod_single->get_social_sharing();?>

Lucian
tagDiv Staff

Hi,

Please try to use the do_shortcode() function, make sure that [dsrc id='2945' ui_div_id='test'] is the right shortcode to add your timer then use the function like this:

<?php echo do_shortcode('[dsrc id='2945' ui_div_id='test']'); ?>
Add the line on your template.

Thanks

  • This reply was modified 11 years by Lucian.
Lucian
tagDiv Staff

Hi,

Please add it using the do_shortcode() function like this: http://screencast.com/t/a8B0TRtck
Here you have the td_login_widget.php file code with the WSL added: http://pastebin.com/FgFmSznX
Or just add this line: do_shortcode('[wordpress_social_login]') like shown in the screenshot above.

Thanks

Lucian
tagDiv Staff

Hi,

You can add the ad short-code using the do_shortcode() function, like this:

<?php echo do_shortcode('[td_ad_box spot_id="custom_ad_1"]'); ?>

Just add this line in your template and the ad code in custom ad box 1 in theme panel > ads.

Thanks

Lucian
tagDiv Staff

Hi,

Add the code for the ad using the do_shortcode() function and the shortcode for the ad you want to use, like this: http://screencast.com/t/FZVXFQqwl
Result: http://screencast.com/t/yomlgOR4B3t
Also make sure you add the ad code inside custom ad 1 in theme panel > ads.
This ex is for the default post templates, if you want to use another post template and you also want the add there you will have to do the same for all post templates: http://screencast.com/t/VdalgQFTh5re

Thanks

Viewing 25 results - 976 through 1,000 (of 1,077 total)