Search Results for 'do_shortcode'

    No search results were found in Documentation!

Results from the Forum
Catalin
tagDiv Staff

Hello tamam,

The simplest way to do this is to use a block which is sorted by latest articles and then, using the do_shoercode method you have to edit the file corresponding to post template used by you. For example, if you are using the post template style 1 you should edit the loop-single-1.php -> https://www.screencast.com/t/hzIXdkGPs54 -> https://www.screencast.com/t/MBVFnZOWvKRa
The code is -> <?php echo do_shortcode('[td_block_1 tdc_css=""]');?>

Thanks for your understanding!

Simion C.
tagDiv Staff

Hi,

You can achieve this using do_shorcode for the slide and news ticker elements – https://www.screencast.com/t/r69O5yQOwhttps://www.screencast.com/t/IevYmognHVo8
Add this code in index.php file – https://www.screencast.com/t/gcBlf2JX so it looks like this – https://www.screencast.com/t/KExUJ75ghT
This is the code for the News ticker and the Slide element

<?php echo do_shortcode('[vc_row][vc_column][td_block_trending_now tdc_css=""][/vc_column][/vc_row][vc_row][vc_column][td_block_slide tdc_css=""][/vc_column][/vc_row]');?>

To hide the “blog” in the breadcrumbs so it displays just “Home” use this code, just enter it in Theme panel->Custom Css

.home .td-bred-no-url-last {
display: none;
}

Result – https://www.screencast.com/t/bTp8TAq7X
Please let me know if this does not work for you or you have further questions

Thanks

Catalin
tagDiv Staff

Hello elcid,

If you want to add the “Custom Ad 1”, you should use the do_shortcode method and place it in theme core file corresponding to post template used by you. For example, if you are using the post template style 1, you should use the following steps in order to achieve as you wish. This is the code – make sure you have an ad code placed in Theme panel->Ads->Custom ad 1 – https://www.screencast.com/t/Mw29z93l9 and then using this snippet of the code
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?> you should add it in loop-single-1.php, where exactly you want to display the add, like this -> https://www.screencast.com/t/eyu4sGgDh

Hope this helps!

Thanks for the message!

Simion C.
tagDiv Staff

Hi,

You could use a do_shortcode with a custom ad inserted in the loop single php file of the coresponding post template that you use, found in the theme files. Example for post template 2 – edit loop-single-2.php like this – https://www.screencast.com/t/4A2gQiM0kIJM and add the code above the top sharing – https://www.screencast.com/t/eYsURewPomd

This is the code – make sure you have an ad code placed in Theme panel->Ads->Custom ad 1 – https://www.screencast.com/t/Mw29z93l9

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

Result – https://www.screencast.com/t/84kV4eKU

As for the size of the ad, it takes the full available width taking in account if there is a sidebar or not – https://www.screencast.com/t/jtmFdrnQ2F
If in your case it is of a much smaller size please provide a link so i can inspect it further.

Thanks

Bogdan B.
tagDiv Staff

Hello,

In order to add a subscription form you will need a plugin as the theme has no such functionality. Then you can use the plugin shortcode to insert it into posts using the do_shortcode function in the post template files.
https://developer.wordpress.org/reference/functions/do_shortcode/ and then use it in the post template files here: https://www.screencast.com/t/fnVTFlVNasG

Thanks

Bogdan B.
tagDiv Staff

Hello,

Unfortunately not all smart lists have ad spots. In smartlist 2 for instance you can only place an ad with custom code added to the theme file directly. You can use a do_shortcode function like in this example: https://forum.tagdiv.com/topic/smart-list-top-ad-bottom-for-featured-image/

Thank you!

cva183
tagDiv Member

Ok so I have managed to figure it out.

<?php
if(get_the_ID()==1735) {
echo do_shortcode(‘[rev_slider alias=”fullsite-block-1″]’);
}
?>

If I do it this way it seems to be working.

cva183
tagDiv Member

Hi Bogdand,

Thanks for helping me 🙂

Problem is…I just dont get it.

So I did this:

Went to cpanel – file manager, edited header style 1. added this code right at the end.

<?php
if(is_home() || is_front_page()){
echo do_shortcode(‘[rev_slider alias=”fullsite-block-1″]’);
}
?>

saved.

Refreshed site – homepage is blank.

What am I doing wrong? This is so frustrating…

  • This reply was modified 9 years by cva183.
kautukbhatnagar
tagDiv Member

Hi @ashishmahajan1,

What i did is i used AccessPress Social Login Lite for social login,
After all API’s within accesspress i used the method posted by Alin [tagDiv]

Here you can find the code so you can implement your shortcode bellow the Forgot password line – http://screencast.com/t/sGHn1sAjRkKA

The proper way would be..

Find this line in Newspaper>parts>header>td-login-modal.php

<div class=”td-login-info-text”>‘ . __td(‘Forgot your password? Get help’, TD_THEME_NAME) . ‘</div>

and replace with below line

<div class=”td-login-info-text”>‘ . __td(‘Forgot your password? Get help’, TD_THEME_NAME) . ‘<br/>’.do_shortcode(‘[apsl-login-lite]’).’</div>

What you’ll get is result in below link
http://www.abhivyakti.in.net/wp-content/uploads/2017/01/social-login.png

hope this helps!!

cva183
tagDiv Member

Rev Slider says there is an option to add this php code… but I dont know where…

<?php
if(is_home() || is_front_page()){
echo do_shortcode(‘[rev_slider alias=”slider1″]’);
}
?>

kuolema
Participant
#0

Hi
i’m using a plugin ADS PRO to generate a code that manages random view of an AD SKIN.
I want to show this ad as a background

The code generated is this:

<?php echo bsa_pro_ad_space('11'); ?>
or
<?php echo do_shortcode('[bsa_pro_ad_space id="1"]'); ?>

I’ve tried putting this code into the body tag, before or just after, but i didn’t manage to let it work properly.

here’s the result: screenshot

as you may see, skin is not overwhelming the menu and both the sides of the main container.
How can i fix that?

Here’s a working version of the skin banner set as normal BACKGROUND from the theme panel

screenshot of working skin ad

ALSO: i don’t want that this banner is seen on mobile devices.

thanks a lot in advance

Simion C.
tagDiv Staff

Hi,

You can insert an ad above the category header by editing the coresponding category style you are using (in your case category template 8) – http://screencast.com/t/fURElqQw and adding the ad do_shortcode for a custom ad just below the php tag like this – http://screencast.com/t/GtNsqsK2jFU3

echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');

Result – http://screencast.com/t/1Mtqyh2gS8
Make sure you have an ad placed in the custom ad your are using from Theme panel->Ads

If you want to put an image as background in the category header you could use this code, changing the image to what you want but making it a link would require further custom work

.td-category-header {
background-image: url("http://wallsdesk.com/wp-content/uploads/2016/11/Dubai-Photos.jpg");
}

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

Thanks

Bogdan B.
tagDiv Staff

Hi,

It’s not easy to customize our theme modules as there are not simple settings for this. Plugins are created for the default wordpress code, not for custom theme elements. If you want to add a custom code to a specific module you will have to alter these files: http://screencast.com/t/lZIQiFEW and then use the implementation method provided by the plugin author if there is one. maybe a do_shortcode function will work: https://developer.wordpress.org/reference/functions/do_shortcode/

Thank you!

poporil
Participant
#0

I would like to put the following code $buffy .= do_shortcode(‘[td_block_ad_box spot_id="custom_ad_4"]‘); right below the featured image of the smart list. Where exactly should I put it. I tried many times but the site doesn’t work afterwards.

Bogdan B.
tagDiv Staff

Hello,

Yes, you can put it in the post template files with a do_shortcode function like so:
<?php echo do_shortcode('[td_block_trending_now tdc_css=""]'); ?>
Then place the code in the template files for each post style that you use:
http://screencast.com/t/0Xf8yeqAdkF

Thank you!

Catalin
tagDiv Staff

Hello Lewis,

You should use the code below at the right file where you want to bring this. I have tested on my side for a post page and seems to work as properly, as you can see here -> http://screencast.com/t/q1pR3mc4

The code is ->

<?php echo do_shortcode('[vc_raw_html]JTNDZGl2JTIwaWQlM0QlMjJQT1NUUVVBUkVfV0lER0VUXzEwMTUxMiUyMiUzRSUzQyUyRmRpdiUzRSUwQSUzQ3NjcmlwdCUyMGRhdGEtY2Zhc3luYyUzRCUyMmZhbHNlJTIyJTNFJTBBJTI4ZnVuY3Rpb24lMjhQJTJDbyUyQ3MlMkN0JTJDUSUyQ3IlMkNlJTI5JTdCUCU1QiUyN1Bvc3RxdWFyZU9iamVjdCUyNyU1RCUzRFElM0JQJTVCUSU1RCUzRFAlNUJRJTVEJTdDJTdDZnVuY3Rpb24lMjglMjklN0IlMjAlMjhQJTVCUSU1RC5xJTNEUCU1QlElNUQucSU3QyU3QyU1QiU1RCUyOS5wdXNoJTI4YXJndW1lbnRzJTI5JTdEJTJDUCU1QlElNUQubCUzRDElMkFuZXclMjBEYXRlJTI4JTI5JTNCciUzRG8uY3JlYXRlRWxlbWVudCUyOHMlMjklMkMlMjBlJTNEby5nZXRFbGVtZW50c0J5VGFnTmFtZSUyOHMlMjklNUIwJTVEJTNCci5hc3luYyUzRDElM0JyLnNyYyUzRHQlM0JlLnBhcmVudE5vZGUuaW5zZXJ0QmVmb3JlJTI4ciUyQ2UlMjklMjAlN0QlMjklMjh3aW5kb3clMkNkb2N1bWVudCUyQyUyN3NjcmlwdCUyNyUyQyUyNyUyRiUyRndpZGdldC5lbmdhZ2V5YS5jb20lMkZfcG9zX2xvYWRlci5qcyUyNyUyQyUyN19fcG9zV2lkZ2V0JTI3JTI5JTNCJTBBX19wb3NXaWRnZXQlMjglMjdjcmVhdGVXaWRnZXQlMjclMkMlN0J3d2VpJTNBJTI3UE9TVFFVQVJFX1dJREdFVF8xMDE1MTIlMjclMkNwdWJpZCUzQTE3NDY2NSUyQ3dlYmlkJTNBMTQ2NzQ4JTJDd2lkJTNBMTAxNTEyJTJDb24lM0ElMjdwb3N0cXVhcmUlMjclN0QlMjklM0IlMEElM0MlMkZzY3JpcHQlM0U=[/vc_raw_html]');
?>

Thanks for your understanding!

Bogdan B.
tagDiv Staff

Well i’m not sure exactly. I don’t know what the code is supposed to do. You will have to try it out in the files mentioned above. The code provider will have an answer about how it should be implemented. I cannot say for sure if it will even work with our theme or not.
I added your code in a simple text block in visual composer and the elements appeared so if you want to implement it instead of the related articles, you can simply remove the realted articles element from the post templates and replace it with a do_shortcode function and use this shortcode

[vc_column_text]
<div id="POSTQUARE_WIDGET_101512"></div>
<script data-cfasync="false">
(function(P,o,s,t,Q,r,e){P['PostquareObject']=Q;P[Q]=P[Q]||function(){ (P[Q].q=P[Q].q||[]).push(arguments)},P[Q].l=1*new Date();r=o.createElement(s), e=o.getElementsByTagName(s)[0];r.async=1;r.src=t;e.parentNode.insertBefore(r,e) })(window,document,'script','//widget.engageya.com/_pos_loader.js','__posWidget');
__posWidget('createWidget',{wwei:'POSTQUARE_WIDGET_101512',pubid:174665,webid:146748,wid:101512,on:'postquare'});
</script>[/vc_column_text]

I hope this helps.

Bogdan B.
tagDiv Staff

Hi,

In order to get a widget below the pagination, you will need to insert it using a shortcode. You will have to edit the theme page template files and use the do_shortcode function of wordpress: https://developer.wordpress.org/reference/functions/do_shortcode/

Thank you!

Catalin
tagDiv Staff

Hello searchspot,

If you want to insert an ad into a category description, you should use the do_shortcode method to do that. First of all, you should install the Seo Yoast plugin because this plugin allows you to use the TinyMCE editor and there you should add your ad, like this -> http://screencast.com/t/xyu0tmV2tX and the result is here -> http://screencast.com/t/tiVrrPjaoNAM Ensure that you have added your Ad code in the Custom Ad 1 from theme panel if you want to bring some results, like this -> http://screencast.com/t/Aw1yAN9Fk

Thanks for your understanding!

Catalin
tagDiv Staff

Hello m0re,

I have explained you above, where exactly you have to add the do_shortcode. Look at this screenshot here -> http://www.screencast.com/t/KXZAwnHrn
If you want to display more levels in our theme and if you are not aware of the steps which are needed to take in this regard, please consider hiring a freelancer/developer to help you because we cannot provide custom work at the moment, sorry!

Thanks for the message!

Catalin
tagDiv Staff

Hello m0re,

If you want to add a banner ad after the featured image into your post you should use the Article Top ad and if you want to add a banner ad above your featured image into your post you should edit the theme core files. So, for example, if you are using the post template style 2 you should edit the loop-single-2.php and add the do_shortcode method with Custom Ad 1 -> http://screencast.com/t/AD0i2sunawJ, like this -> http://screencast.com/t/KXZAwnHrn The result is here -> http://screencast.com/t/akbXu4rd2

Hope this helps!

Thanks for the message!

eddycom
tagDiv Member

Thanks

Like this? I used this code in “part > header > header-style-1.php” for Custom Ad bottom menu. It’s work fine.

<?php
if (in_category(array(‘CATEGORY_ID_EXAMPLE_1’,))){
echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_1"]‘);
}
else{
locate_template(‘parts/header/ads.php’, true);
}
?>

<?php
if (in_category(array(‘CATEGORY_ID_EXAMPLE_2’,))){
echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_2"]‘);
}
else{
locate_template(‘parts/header/ads.php’, true);
}
?>

I used “if in_category” to show the Ads in all post on each category. But doesn’t work in “part > header > ads.php”.

I would like to show Ads in some category (get banner from Ads panel or Custom Ad)

Can you help me please?
Thanks

Catalin
tagDiv Staff

Hello rodrigosicone,

Unfortunately, our theme does not have any such an option that allows you a way to add this type of button, sorry! You should use a plugin which has this functionality and then, using the do_shortcode you should add it to the theme core files where the top bar menu is created, like this -> http://screencast.com/t/x5M7eoqatWwh Notice that is no a simple task and if you are not aware of the steps which are needed to take in this regard, please consider hiring a freelancer/developer to help you!

Thanks for the message!

xGnux
Participant
#0

Hi,
when i enter a shortcode in the category description, it just shows as text but not the actual shortcode. Can you tell me how to fix it?

I tried this but it does not work 🙁
add_filter( 'widget_text', 'shortcode_unautop');
add_filter( 'widget_text', 'do_shortcode');

Alin [tagDiv]
tagDiv Staff

Hi,

1. I guess you have set white background and text color globally from Theme Panel > Theme Colors – http://screencast.com/t/kYSvK5ML48x This setting affects also the Related Articles block.
If you really need to use it like that, then you can overwrite it using custom css in Theme Panel > Custom Css – http://screencast.com/t/bYOalphRQ

.td_block_related_posts .td-related-title .td-cur-simple-item {
color: #222;
}

2. You will need custom modifications for this. You can try to add a condition here in this file and display a custom ad for your specific categories – http://screencast.com/t/XjqcaUqmsM You can use is_category function – https://developer.wordpress.org/reference/functions/is_category/ and do_shortcode for a custom ad – https://developer.wordpress.org/reference/functions/do_shortcode/

Thanks!

Viewing 25 results - 326 through 350 (of 1,077 total)