Search Results for 'do_shortcode'

Results from the Forum
Catalin
tagDiv Staff

Hello geolux,

If you want this, you will have to use the do_shortcode method to add everything you want at this page. So, first of all, you should prepare your block in Visual Composer, filtered by latest articles and then take the shortcode generated by this plugin and with this function, add this in the core file where the bbpress is created, like bbpress.php file, like this -> http://screencast.com/t/XnkATDX2x -> http://screencast.com/t/bJwEiALFLTBS -> http://screencast.com/t/gxnsl7KIrYc Please read this guide to learn how to filter posts inside blocks: https://forum.tagdiv.com/block-settings-guide/ For more information about do_shoercode method, please check this topic here -> https://forum.tagdiv.com/topic/add-content-block-in-the-posts-below-social-sharing/
Please notice that is not a simple task and if you are not aware of the steps in this regard, please consider hiring a freelancer/developer to help you because we cannot provide custom work at the moment, sorry!

Hope this helps!

Thanks for your understanding!

Bogdan B.
tagDiv Staff

Hello,

The mobile theme will not allow any blocks to be added on posts. It only uses on grid created specifically for the homepage and the rest are modules again created specifically for the mobile theme. The theme blocks you can see on desktop cannot be used on the mobile theme as it;s a totally different theme. You must think of the mobile theme as a separate theme that does not have those elements. You cannot use an element from one theme on another. If you want to have the default blocks from our theme on mobile, simply deactivate the mobile theme and use the standard responsive version. That way the mobile version will be able top provide the blocks you need if you add a block to the post template with a do_shortcode function.
As for the social icons, there is no easy way of adding a new social network. They are hard-coded and can only be altered from the theme files.
Here are a couple of examples:
https://forum.tagdiv.com/topic/add-a-linkedin-button/
https://forum.tagdiv.com/topic/so-i-added-a-stumbleupon-sharing-button/

Thank you!

Andrei L.
tagDiv Member

Hi

1,3: Please provide your site url so we can have a closer look and get back to you with a more accurate answer.
2. To achieve that you will need some customization in theme’s core files. If the plugin generate shortcodes then you can use do_shortcode() function to achieve that: http://screencast.com/t/lJ4w3ayLi and for mobile here: http://screencast.com/t/NiQwXWenYrO

' . do_shortcode('shortcode-goes-here') . '

Note that the plugin is not tested and we can’t guarantee that it will work fine with Newspaper theme.
Thanks!

Alin [tagDiv]
tagDiv Staff

Hi,

This was what I asked you. Did you implemented the custom ad in the post template that you use?
If this is what you mean, your code modification was removed by the update and you need to re-add your custom ad to your template above the post title(I see you use post style 2) – http://screencast.com/t/Z5Grx8bgRFZ
So you could try to use do_shortcode function and implement the custom ad there – http://screencast.com/t/TY8jivNVEoOhttp://screencast.com/t/xnBmuwlU04g

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

Hope this helps!

Andrei L.
tagDiv Member

Hi

To achieve that you will also need some custom modules, there you have to call the images, and new thumb sizes. The new thumbs can be defined in td_config.php: https://forum.tagdiv.com/td_api_thumbadd/ Also you can’t use the new block in td-container which have a fixed width. You can add a new container above td-container, make it full width and use do_shortcode() to echo out the new block: http://screencast.com/t/NcwL9mrQJv1

Thanks!

doo
tagDiv Member

UPD: Correct shortcode
if( !is_admin() ) {
add_filter( 'the_title', function( $title ) {
return do_shortcode($title);
} );
}

function year_shortcode() {
$year = date('Y');
return $year;
}
add_shortcode('year', 'year_shortcode');

doo
Participant
#0

Hello, i use shortcode [year] in my post titles and it works fine, but not in related articles/more from author when list of posts ajax loaded. For example – http://joxi.ru/xAevy9pSYoMpar. How can i fix it?

Shortcode:

if( !is_admin() ) {
	add_filter( 'the_title', function( $title ) {
		return do_shortcode($title);
	} );
}
weeshsrl
tagDiv Member

Done,
but i have the same behaviour.
I’ve tried to put the same php do_shortcode on the header-style-1.php file, and i just get a really short flash showing the first banner.
Thank You

weeshsrl
tagDiv Member

I’m meeting some problem using a shortcode in the Header AD section of theme config.
I have a shortcode like that :
[pro_ad_display_adzone id=”1056″]

I’ve tried to put :
[pro_ad_display_adzone id=”1056″]
and
<?php echo do_shortcode(“[pro_ad_display_adzone id=1056]”); ?>
in the “Your Header AD” field.
I have no results. Sometimes, just a fast “flash” with the first banner to show.

Moreover, if i put the same shortcode inside a page, in a text block, the shortcode runs perfectly.

The pugin i’m using is “WP Pro Ad System”

Do you have any suggestion?
Thank You
Maurizio

Catalin
tagDiv Staff

Hello hadharm,

As a hint, you can try to use the do_shortcode() method for calling that shortcode. For more information about functionalities of this method, please consult here -> https://developer.wordpress.org/reference/functions/do_shortcode/

Thanks for your message!

Catalin
tagDiv Staff

Hi jmask,

If you want to add a category image for each category which has template style 8, please notice that you should use a bit of CSS code in order to achieve this. So, first of all, you will have to take the category ID for what category you want to add the image and that, with the background-image rule of CSS you can add your desired image. Below, I gave you an example for one category, like this ->

The code is ->

.category-89 .td-category-header.td-image-gradient-style8 {
background-image: url(http://demo.tagdiv.com/newspaper/wp-content/uploads/2016/05/login-mod.jpg);
background-size:100% 100%;
background-repeat: no-repeat;
border-color:red;
}

The result you should see here -> http://screencast.com/t/cxIhL9poCkUC

For your second request, if you want to add some content or spot, please notice that you should use the do_shortcode method with some Visual Composer element (as an example Text Block) and then, the shortcode of it, you can add in td_category_template_8.php like this -> http://screencast.com/t/oZDdl9FjV
If you are not aware of the steps in this regard, please consider hiring a freelancer/developer to help you because we cannot provide custom work at the moment, sorry!

Thanks for your understanding!

Andrei L.
tagDiv Member

HI

You can use header style 8 which display the ad below the menu: http://screencast.com/t/jzHTTwvT Also you can use do_shortcode() function in header file to echo out a custom ad-spot, for more details please check this link: https://forum.tagdiv.com/topic/need-ads-header-above/

Thanks!

Bogdan B.
tagDiv Staff

Hello,

If you want to change the article bottom position you have to edit the theme files. First you need to deactivate the ad spot and manually add it in the position you want from the theme files using a do_shortcode function. Here is the code you can use: <?php echo do_shortcode('[td_block_ad_box spot_id="content_bottom"]');?>
You can then place the code in the post files here: http://screencast.com/t/GohSneFoD

Thank you!

Nano
tagDiv Member

Hey Catalin,
I am sure that those files /codes must have been modified in last two years, I am not sure whether support people or their heltping nature or support rules have also changed in these two years. Going to the strict rule book, no cusomizations are allowed by going to the past experience and community building book, you guys have always helped us ( users ) in helping for small customisations.

That’s why Lucian had helped two years back and probably you will help me now too 🙂

taking help from your screenshot, I added the short code here: https://snag.gy/aeiqy5.jpg

The full line that I added is:

' . do_shortcode('[fbl_login_button redirect="" hide_if_logged=""]') . '

In result , I get this in ajax login box: https://i.snag.gy/J0Y6oK.jpg

As you can notice, the only issue now is to move “Connect with Facebook” down below “LOGIN” text. What should I do for this? Should I change the postition of code in td_login_modal.php or add some code in custom CSS.

Please try to look at this.

Thank you.

Bogdan B.
tagDiv Staff

Hi,

You can use the ad in a custom ad spot in your theme panel: http://screencast.com/t/swJWM7MHe
Make sure you use this method as it not an adsense ad: https://forum.tagdiv.com/using-other-ads-non-adsense-ads/
Then you can use a do_shortcode function inside the theme files to make the theme render the shortcode in your desired location. you can add it in the header if you want to have it above all of the content. Depending on the header ad that you use, you can add the code like so:
http://screencast.com/t/b8zN12pDb
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?>

Thanks.

webstone24
tagDiv Member

Unfortunatly even NO WORK.

My ads.php looks now:

<div class=”td-header-rec-wrap”>
<?php
// show the header ad spot
echo td_global_blocks::get_instance(‘td_block_ad_box’)->render(array(‘spot_id’ => ‘header’));
if (is_category(‘mainz-mingen’))
{
echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_3"]‘);
}
else
{
echo td_global_blocks::get_instance(‘td_block_ad_box’)->render(array(‘spot_id’ => ‘header’));
}
?>
</div>

So – do I have to take any other changes in any other files?

So as I understood I have to use if in_category – because I wan to show this other graphic (placed in custom ad 3) on EVERY POST, which is made IN THIS CATEGORY.

I did´nt know that this could be such a problem, I thought I can change this in the panel by choosing, cos I´m not a really *.php genius 🙂

Bogdan B.
tagDiv Staff

Hello Yucca,

You can edit the theme template files that correspond to each post style you use on your site and use a do_shortcode function like so:
<?php echo do_shortcode('[vc_row][vc_column][td_block_5 custom_title="Block title2" limit="3"][/vc_column][/vc_row]');?>
http://screencast.com/t/2QKMvATQ2jY
You can get the shortcodes for any block from visual composer if you access the classic mode and text mode in the mce editor: http://screencast.com/t/c8HfwvZt

Thank you!

Andrei L.
tagDiv Member

Hi

You’re using in_category() function in your condition which is not correct. To check if a specific category page is displayed you need to use is_category(), please check my first reply from indicated thread.
The condition should look like this:

if (is_category('cat-name'){
echo do_shortcode(‘[td_block_ad_box spot_id=”custom_ad_3″]’);
}
else{
echo td_global_blocks::get_instance(‘td_block_ad_box’)->render(array(‘spot_id’ => ‘header’)); ?>
}

Thanks!

Catalin
tagDiv Staff

Hello Glance,

The color of this button can be changed from Visual Composer, like this -> http://screencast.com/t/9UZzB0AGVaX All of these modifications should be made before copying the code in do_shortcode and then you switch to the classic mode and the shortcode of the button with the color will appear, like this -> http://screencast.com/t/vAofNMUgMS. Also, please notice that you can insert the button everywhere you want into your site.

Thanks.

Bogdan B.
tagDiv Staff

Hi,

In order to make that customization you need to edit the file coresponding to the post template that you use and add a do_shortcode function like so: http://screencast.com/t/PCP8QoY0P

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

Thank you!

webstone24
tagDiv Member

Unfortunatly it doesn´t work.
I have 2 pics:
The main pic (have to displayed EVERYWHERE, “INSTEAD” of posts in the category/regional/mainz-bingen area).
I have the NEWSPAPER theme – found the ads.php, I added the code, so the ads.php looks now:

<div class=”td-header-rec-wrap”>
<?php

// show the header ad spot
echo td_global_blocks::get_instance(‘td_block_ad_box’)->render(array(‘spot_id’ => ‘header’)); ?>
<?php
if (in_category(array(‘mainz-bingen’))){
echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_3"]‘);
}
else{
locate_template(‘parts/header/ads.php’, true);
}
?>

</div>

I made an CUSTOM AD 3 also on the THEME PANEL -> ADS – there is the inculded code:

<div class=”td-all-devices”></div>

The HEADER AD looks as follow:

<div class=”td-all-devices”></div>

So – what did I wrong?

Catalin
tagDiv Staff

Hello madox56,

Unfortunately, our theme does not have such an option for it but only if you will use a bit of code to achieve this. If you want to add some blocks as content in your Woocommerce template, you will have to use the do_shortcode method to add this before or after the woo commerce products, like this -> http://screencast.com/t/hLkiEgIy for each case.

Hope this helps!

Thanks for your message!

Alin [tagDiv]
tagDiv Staff

Hi,

You can use do_shortcode function and place a custom ad bellow the menu in header style 3 template file – http://screencast.com/t/O9jUnYRO

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

And control the ad visibility from Theme Panel > Ads. Disable header ad for phone devices and the custom ad for the other devices – http://screencast.com/t/JMLmIWxTyJRhttp://screencast.com/t/CvWqdTeMuFQf Or use the specific div containers for non-adsense code – https://forum.tagdiv.com/using-other-ads-non-adsense-ads/

Thanks!

Andrei L.
tagDiv Member

Hi

1. You ca use do_shortcode() function in search.php file: http://screencast.com/t/I72dALrU0GJ and pass it as parameter ad’s box shortcode from Visual Composer
2. When you’re using sidebar on posts the content have a width by 680px and the ad can’t be higher then that value. The only way is to not use sidebar and the ad will be displayed at 720px.

Thanks!

Catalin
tagDiv Staff

Hello bvanrij,

If you want to do this customisation, please notice that you will have to add some conditions in Woocommerce template, archive-product.php core file , like this -> http://screencast.com/t/Zk0MikVOa You will have to use the do_shortcode method and you will have to replace the woocommerce_content() with your desired Block which you want to have as default, using this method. Also, please notice that you will have to edit each case *sidebar_left, *no sidebar, *default. Also, you will need to make some adjustments with CSS code in order to achieve best results.

Hope this helps and good luck into your project.

Thanks.

Viewing 25 results - 401 through 425 (of 1,077 total)