Search Results for 'do_shortcode'

Results from the Forum
Bogdan B.
tagDiv Staff

Hello,
There is an article top ad spot in our theme. you can find it here: http://screencast.com/t/nKUxo4F4S
This will however insert the ad below the featured image. If you want to have it above the image and below the title, you will need to edit the theme files to do it. You have to edit each file corresponding to the post templates (every post style has it’s own file).
You can use this code: do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
and add it inside the theme files: http://screencast.com/t/W6NJM10dJSab
Make sure you have an ad placed in the ‘custom ad 1’ spot.
Thank you!

Airane
Participant
#0

Hi,
I want to place an custom ad on posts between social sharing and related post on my site (http://soutaoboa.com/as-vezes-um-carinho-cai-tao-bem/). But this one ad should only be visible to mobile visitors.

So:
I have a custom ad 1 and the code is in place (not adsense);
Did a call for the shortcode:
<?php echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_1"]‘)?> on loop-single file;
On the style.css I have:

@media
only screen and (max-width: 767px) {
.td-a-rec-id-custom_ad_1{
position:center!important;
};
The problem is that the ad is there but visible to everyone.

What I’m doing wrong?
Thanks
P.S. I have a child theme.

Bogdan B.
tagDiv Staff

Hello,
Smartlists have a few predefined ad spots you can see here: http://screencast.com/t/6dxnTI5UF7
If you want to have a custom ad spot in one of the smartlists, you will have to hard-code it in the smartlist files. Every smartlist type has it’s own file: http://screencast.com/t/wVoP3FGfHN
For example on a smartlist 1 you can place an ad inside the file like so:
use this code: $buffy .= do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
And use it inside the smartlist 7 file: http://screencast.com/t/AGeYGuG4OsdL
It will not work everywhere though as smartlists are very complex elements.
Hope this helps.
Thank you!

Bogdan B.
tagDiv Staff

Hi,

You can use the in_category function and use the do_shortcode function as well if you plan to use visual composer shortcodes.
You wanted it to show at the top of every sidebar so you would place the code at the top of the sidebar file. like so:
http://screencast.com/t/AsflY1dxoby8
if (in_category('category-slug')){
echo do_shortcode('[vc_posts_slider count="1" interval="3" thumb_size="large" posts_in="3429"]');
}
elseif (in_category('category-slug2')){
echo do_shortcode('[vc_posts_slider count="1" interval="3" thumb_size="large" posts_in="3429"]');
}

Hope this helps.

Bogdan B.
tagDiv Staff

Hello Farrah,

This can be done but it will come with a cost. Our search widget uses a live ajax search that returns results live inside the box without having to click the search button. The live search will not be so easy to implement like you want as there is quite a bit of code that needs to be changed. We recommend hiring a developer for this task.
There is an alternative however. You could add the standard wp search box (it looks the same) only there will not be a live search, so people will have to click the search button in order to get results.
For this you will have to first remove the theme search widget and add the wp one like so:
You need to edit header-menu.php and change the search part of the code like so:
http://screencast.com/t/EwAqo2mjYrR8
Replace the code with this one:

<div class="td-search-wrapper">
    <div id="td-top-search">
        <!-- Search -->
        <div class="header-search-wrap">
<?php echo do_shortcode('[vc_wp_search]'); ?>
        </div>
    </div>
</div>

http://screencast.com/t/qobvZoKXqq

And then use this css for positioning:

#td-top-search{
width:30%!important;
}
@media (max-width:767px){
#td-top-search{
display:none!important;
}
}

Hope this helps.
Thank you!

Bogdan B.
tagDiv Staff

Hello,
This is the answer we provided via email:

You can use do_shortcode function to display and ad under posts title. To achieve that you need to edit each file corresponding with post template used: http://screencast.com/t/arZcXGgJn and paste the indicated code under get_title() function. The result will be like here: http://screencast.com/t/ilpOPPKqWI

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

To get the shortcode add an ad box into a blank page then switch in backend editor copy and paste this code: http://screencast.com/t/Kcqsjk9C7xbU inside do_shortcode function.
I used custom ad 1 in this example but you can use any of the custom ad-spot, just update the number from shortcode. Ex: for custom ad 4 the shortcode will be [td_block_ad_box spot_id="custom_ad_4"]

Also you can use the ad-shortcode to display ads in post contend. Just paste the shortcode in post editor where you want to display the ad: http://screencast.com/t/NKZwVCHBhttp://screencast.com/t/LrLini74nH2

Thanks!

Bogdan B.
tagDiv Staff

Hello,

The theme only offers the ad spots from the theme panel. Please understand that any other ad placement you want will have to be made custom and coding skills will be required. For the standard ads from the panel, there are options to hide ads on particular viewports: http://screencast.com/t/iICtxBzkK
If you want to place ads besides the website you need to add them in header.php and then use css to position them with a (fixed position) and hide them for tablet portrait and mobile using media queries.
For example:
You can use a do_shortcode function to add your banner to the site. You can use one of the custom ad spots for it: http://screencast.com/t/XPYCo8hdzn
Then you can target it with css for positioning:
.td-a-rec-id-custom_ad_1{
position:fixed!important;
left:0;
top:300px;
z-index:99999
}

You can repeat this fort the right side ad.

Hope this helps.
Thanks.

Andrei L.
tagDiv Member

Hi

Newsmag theme works with shortcodes as well as Newspaper and if the ad’s shortcode it’s valid it should be displayed fine. To display the ad in header using do_shortcode() function you need to edit the ads.php file and place the code here: http://screencast.com/t/zL2e3slyo
Note that the WP PRO Advertising was not tested to work with the theme and we cannot grantee that will work fine. However if the plugin generate shortcodes then using the indicated function the ads should be displayed fine.

Thanks!

tsatiroglu
Participant
#0

Help I am trying to use WP PRO Advertising System plugin on Newsmag. I want to place a leaderboard ad 728×90 on header. The plugin works with shortcodes eg:[pro_ad_display_adzone id=”168552″] and I entered the code on ads section on the Theme Panel but it didn’t work as nothing is displayed. I checked the forum and it appears the shortcodes work with Newspaper theme’s ads panel but I could not find any mention of the Newsmag theme.

The plugin also works by adding this code to the corresponding php file:
<php echo do_shortcode(“[pro_ad_display_adzone id=168552]”); ?>

I think this code should go into either ads.php or header-style-1.php but I am not sure where I should put this code. Could you please tell me where I should insert this code?

I appreciate your help here.
Kind regards,
Tunç
my site is kanalfinans.com

Bogdan B.
tagDiv Staff

Hello,
You will have to place the adsense in the theme panel in one of the ad spots (for example custom ad 1) adn then use the do_shortcode function in the php file:
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]')?>
Hope this helps.
Thanks.

Andrei L.
tagDiv Member

Hi

You can insert a new container near page content in header.php file like here: http://screencast.com/t/XmNVmU8j0c http://screencast.com/t/cl1dXMVb In this container you can display any add, including a shortcode for a specific ad-spot using do_shortcode() function. http://screencast.com/t/Fbx66wcDI2m

Hope this help.
Thanks!

Tech Lifestyle
Participant
#0

Hi,
we need to set background Ad but from third party AD Plugin (WP Pro Advertising) we install.
We need to put somewhere in NewsMag theme short code we have, but we don’t know where…

Code type: <?php echo do_shortcode(“[pro_ad_display_adzone id=xxxxxx]”); ?>

Thanks for help

Andrei L.
tagDiv Member

Hi

You can modify the file corresponding with the header style used and add your code under the menu container. header is an example for header style 1: http://screencast.com/t/Sd3ksqnkfF Also you can use do_shortcode function if you’re using one of theme’s ad-spots to display the image: http://screencast.com/t/RejwRCvbdhttp://screencast.com/t/2vlRSiLqwPk

Hope this help.
Thanks!

pasqualino77
Participant
#0

Hi i want insert a custom ads fox ex. custom ads 4 before title

I try to insert
<?php echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_4"]‘);?>

In single php or single 1.php

I can not figure out what the exact spot to place it before the title.

How i can insert before title and before related article (custom ad 5)

Andrei L.
tagDiv Member

Hi

1. The code which render the ad-spots it’s located in td_block_ad_box.php: http://screencast.com/t/PqHOTJvI

2. I assume that that you want to display different ad-spots according with the post type displayed. To achieve that you will need a condition which check what post type it’s displayed and depending by result display a specific ad. Here is an example for header ad: http://screencast.com/t/4e9sKBons This is just a basic example about how can you check what post type it’s displayed and manipulate the ads according with the result.
You can create new ad-spots following the solution offered in this topic: https://forum.tagdiv.com/topic/how-to-add-more-custom-ad-spots/ and use them in your post types.
Using do_shortcode function and some proper conditions you can display ads according by the custom post type displayed. For more details about the function’s usage check these links: https://forum.tagdiv.com/topic/different-ad-tags-for-the-category-templates-vs-the-homepage/
https://forum.tagdiv.com/topic/sub-page-no-standard-top/https://forum.tagdiv.com/topic/header-ad-on-top-of-menu/

I hope this help but if you need additional informations please provide more specific details about what you’re trying to do and maybe I can help.

Thanks!

Bogdan B.
tagDiv Staff

Hi,
First try the code in a default ad spot in the theme panel to see if it will display properly:
Then you can try it inside the theme files http://screencast.com/t/IMbThP1nkKp then if it works from the theme panel you can use a do_shortcode function inside the footer.php file like so:
do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]')?>
(note that this code uses the custom ad 1 spot so you need to place your ad in the custom ad 1 field)
Thanks.

Andrei L.
tagDiv Member

Hi

The solution I provided works only with shortcodes from Visual Composer so you have to use a video player like here in order to work: http://screencast.com/t/INPzaKOP4Thttp://screencast.com/t/dx0Z4dKrMV

This is an example code which will work with do_shortcode function:
<?php echo do_shortcode('[vc_row][vc_column][vc_video link="https://www.youtube.com/watch?v=qkeZA6JU3Zw"][/vc_column][/vc_row]'); ?>

The featured video don’t generate shortcode now and you will need a custom implementation to achieve that. You can take a look here for more details about how shortcodes works: https://codex.wordpress.org/Shortcode_APIhttps://codex.wordpress.org/Function_Reference/add_shortcode and evantualy try to create a new shortcode for the featured video.

Hope this help.
Thanks!

  • This reply was modified 10 years by Andrei L..
Bogdan B.
tagDiv Staff

Helloo,
It depends on the code you want to implement. If it’s a shortcode from a plugin, you can add it inside the post content or in the template files replacing our theme comments.
You can use this code:
do_shortcode('add your shortcode here');?>
And add it inside one of the template files: http://screencast.com/t/1ycMNzPJko
Hope this helps.
Thanks.

Catalin
tagDiv Staff

Hello Timo,

If you want to add blocks content underneath of the comment section for each post, you can do that if you are using do_shortcode method. First of all, you have to get the block shortcode from Visual Composer, like this -> http://screencast.com/t/0q9H5cbW -> http://screencast.com/t/Ei4AYqlilpc Please notice that you have to introduce the code for each single template is used by you.

The code is ->

<?php echo do_shortcode('[vc_row][vc_column][td_block_13][/vc_column][/vc_row]');?>

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

Hope this helps!

Thank you for the message!

Marto
Participant
#0

Hello,

I want to change the default position of Facebook comments plugin.
https://wordpress.org/plugins/facebook-comments-plugin/

I read most topic in the forum and you say to use
echo do_shortcode('[fbcomments]'); ?>
instead of
<?php echo do_shortcode('[fbcomments]'); ?>

When I use echo do_shortcode('[fbcomments]'); ?> the comments don’t appear.

My question is, is it good to use <?php echo do_shortcode('[fbcomments]'); ?>

I put them in all post template styles loop-single.php, loop-single-1.php etc. right after the item I want the comments to appear on new line.

My second question is, if there is a way to disable them by default and use the shortcodes to prevent appearing twice, instead of disabling them every time when I type new post?

Please correct me if I am wrong so I make them work properly.
Thanks!

alicestudio
tagDiv Member

hi Bogdan,

thank you.

I did exactly what you kindly suggested, look:

<div class="td-main-content-wrap">^M
^M
<div class="td-container td-post-template-1 <?php echo $td_sidebar_position; ?>">^M
<div class="td-crumb-container"><?php echo td_page_generator::get_single_breadcrumbs($td_mod_single->title); ?></div>^M

<?php echo do_shortcode('[td_block_ad_box_spot_id="custom_ad_4"]')?>

<div class="td-pb-row">^M
<?php^M
^M
//the default template^M
switch ($loop_sidebar_position) {^M
default:^M
?>^M

it shows on the page as text: [td_block_ad_box_spot_id=”custom_ad_4″]
http://snag.gy/xrnsX.jpg

let me know
thank you

Bogdan B.
tagDiv Staff

Hi,
Maybe you did it wrong. Try it like so: http://screencast.com/t/fdqPjCsJk
result: http://screencast.com/t/YXaff1saCqmT (I added it below the crumbs.you can add it above if you want)
If you add it above the breadcrumbs, there will be no margin on top so in this cae you will need to make use of a bit of htm and css and add the code inside a div like for example
<div class="mycustomad"><?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_4"]')?></div>
and then use css to apply a margin-top for positioning:

.mycustomad{
margin-top:10px;
}

I hope this helps.
Thanks.

Bogdan B.
tagDiv Staff

Hi,
You can add your custom ad in an ad box in visual composer and then get the sortcode for it. For example
[td_block_ad_box spot_id="custom_ad_1"]
Then you can use the do_shortcode function like so:
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]')?>
Then you can insert this code directly in one of the post template files: http://screencast.com/t/XcVZQFqLiS
Add the code where you want it to appear: http://screencast.com/t/JiV0WVpXx
Thanks.

Catalin
tagDiv Staff

Hello poporil,

If you want to change the icon for Comments with the word Comments, you have to alter the code where this icon is called, like this -> http://screencast.com/t/WL593sA7lj7 and the result you should see here -> http://screencast.com/t/Rmvt4xr2
For your second request, I suppose that you want to add other block under the related articles. If you want to do that, you have to alter the code from this type of template and use do_shortcode method to add the block. Please follow the next steps in order to achieve as you wish. In continuation, I will give you an example for inserting block_1 in post template style 1. First of all, you have to add the code from Visual Composer like this -> http://screencast.com/t/AxKsYI5m and the code will be this -> do_shortcode('[td_block_1]');?> and you have to implement it inside this core file, like this -> http://screencast.com/t/KJSfXWdeDpIU and the result you should see here -> http://screencast.com/t/i1x6gGi58bL3

Hope this helps!

Thank you for the message!

Federated Media
Participant
#0

I am trying to add a custom php template code in order to use an add manager to schedule my backgrounds.

<?php echo do_shortcode(“[pro_ad_display_adzone id=41140]”); ?>

The plugin I am using tells me to put this adobe the body but I am not sure exactly the best place to put it. I would like to use the code above to go over the theme’s background so I can use this plugins ad manager. The ad manager allows us to schedule background ads when needed. Any help with this will be greatly appreciated!

Viewing 25 results - 626 through 650 (of 1,077 total)