Search Results for 'do_shortcode'

Results from the Forum
Lucian
tagDiv Staff

Hi,

What are you trying to add there? You could use the do_shortcode function to add a block for example, just go to loop-single.php file or other post templates http://screencast.com/t/8IeXdCKghap, depending on where do you want to display this and add your custom made block (use page builder to build your block as you like and then copy the shortcode http://screencast.com/t/Ed8kiEm5Xk3t and add it in the do_shortcode function) like this: http://screencast.com/t/02WxPlCC3vE

This how your code should look like:

<?php do_shortcode('[td_block3 limit="6" header_color="#000000" header_text_color="#ffffff" title_style="td_title_style_1"]'); ?>

Hope this helps!
Thanks!

Lucian
tagDiv Staff

Hi,

You can use the do_shortcode function and add the ad to the attachment page template like this: http://screencast.com/t/tP77pTc4a

You can find the other ad boxes short-codes here

Here is the code I used:
<?php echo do_shortcode('[td_ad_box spot_id="custom_ad_3"]') ?>
Just make sure you have the ad code in the ad box in Theme Panel > Ads: http://screencast.com/t/CPxv1iSrw
Should get this result: http://screencast.com/t/0W2FtlZU

Thanks

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

Hi,

Please try this http://screencast.com/t/uy1TApMv and check to see if the source it’s still under the FB comment plugin.

If this dose not help to put the source and via directly under the post content you can try to disable or hide the FB comment from showing after post content and add it yourself in the loop-single.php file using the do_shortcode('[fbcomments]'); function like Emil suggested above.

Hope this helps!
Thanks

Emil G
tagDiv Staff

Hi,

Check if the plugin has a shortcode, disable the automatic position and use the do_shortcode(‘[fbcomments]’); to display it on the desired location inside the loop-single or single templates (depending on the chosen post style) – http://screencast.com/t/7CGnM9iJ

http://peadig.com/wordpress-plugins/facebook-comments/

Thank you, Emil G.

mehedi
tagDiv Member

Hi

I used this before:

<?php
 do_shortcode('[vc_row][vc_column][td_block6 limit="5"][/vc_column][/vc_row][vc_row][vc_column   width="1/1"][/vc_column][/vc_row]');
?>

But didn’t work. Any idea?

Lucian
tagDiv Staff

Hi,

Use page builder to create and customize your block then move to classic mode get the shortcode and add it using the do_shortcode function in which template you like.
You can search the forum or the web on how to add the shortcode using this method.

Thanks

sbo
tagDiv Member

What is the article_bottom_ad? I tried the below and no luck.
<?php echo do_shortcode(‘[td_ad_box spot_id=”article_bottom_ad”]’); ?>

This right here is basically what im trying to accomplish:
http://screencast.com/t/r9hhfebNt7d

Moving the 728×90 below <!–nextpage–> shortcode, center pagination, removing the numbers in between the first and last page but keeping the amount there and create the buttons larger. And inserting the pagination above the image.

I would have imagined the ad code would be in loop-single, or if there is a php echo code that can be placed inside there.

*For the time being, I manually placed the ad code in loop-single.php and removed the article_bottom_ad.*

  • This reply was modified 12 years by sbo.
  • This reply was modified 12 years by sbo.
Lucian
tagDiv Staff

Hi,

You can try adding it using the do_shortcode function for custom ad box and add it like this in the loop-single.php file: http://screencast.com/t/QexjAdJiBuVZ

Here is the code you need:

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

Also add your ad code inside the Custom ad 3 like this: http://screencast.com/t/IdQeUAdg

This way you have to remove the article bottom ad and the custom ad will remain under the pagination and above the prev/next post.

Use this css to arange it:

.single .td-a-rec-id-custom_ad_3 {
margin-top: -20px !important;
margin-bottom: 20px !important;
}  

Use this class to style the post pagination:

.page-nav-post {
padding: 0px;
margin-bottom: 42px;
}

like this: http://screencast.com/t/OZmQAGbb

Hope this helps!
Thanks

Lucian
tagDiv Staff

Hi,

Please try adding it using the do_shortcode function and add it like this in the tag.php file: http://screencast.com/t/r7Xfu8gYyCJy

Also add your code inside the Custom ad 3 like this: http://screencast.com/t/IdQeUAdg

Also add this CSS in Theme Panel > Cusotm CSS:

.tag .td-a-rec-id-custom_ad_3 {
margin-top: 20px;
margin-bottom: 10px;
}

Hope this works.

Thanks

Lucian
tagDiv Staff

Hi,

First remove this code: http://screencast.com/t/8GHWhkt6 then using the do_shortcode() function add the slider to the template like this: http://screencast.com/t/G4bkCbMibT.

<?php echo do_shortcode('slide shortcode here') ?>

Hope this helps!
Thanks

garfieldx
tagDiv Member

Hi Lucian,

very cool! Worked for me! I extended it a little bit, that it can use more than one tag and does not appear at all, if there is none:


$post_tags = get_the_tags();
$tags_filter = '';
		
if ($post_tags)
{
  for($i=0;$i<count(array_values($post_tags));$i++)
  {
    $tags_filter .= array_values($post_tags)[$i]->slug.',';
  }
			
  $tags_filter = substr($tags_filter,0,-1);
  echo do_shortcode('[td_block4 tag_slug=' . '"' . $tags_filter . '"' . ' limit="5" custom_title="'Related Posts'"]');
}

Thanks for your help!

BR, Claudio

Lucian
tagDiv Staff

Hi,

You can use the theme slider and from what you writhed, I understand that you want to add a slider displaying featured posts, you can add a slider to your page using Page Builder like this: http://screencast.com/t/xHAbuxqA

Also you can use the Revolution Slider plugin, if you don’t know how to create a slider follow this steps:
https://forum.tagdiv.com/topic/revolution-sliders-source-post-not-working/#post-15382

The Revolution Slider sliders can also be displayed using the do_shortcode() function in template.

Thanks

Lucian
tagDiv Staff

Hi,

You can do it by adding the block from single.php file before the sidebar using the do_shortcode() function like this: http://screencast.com/t/0diGnANrnc

This way you will display first in the sidebar a “Related Posts” section by current posts first tag, it will display the posts that have the tag which is first on current post tags, it’s using block 5. You can customize the block from page builder and you can find the shortcode if you switch to classic mode.

Here you have the code from my example: http://pastebin.com/pZNUHNTL
You can do the same in case the sidebar is on the left side.

Result: http://screencast.com/t/xaqyue8Wc
Let me know if it works.

Thanks

Lucian
tagDiv Staff

Hi,

Yes you can insert a block via shortcode in your post, use page builder to customize your block then switch to classic mode and get the shortcode http://screencast.com/t/VgMmLCxmWq
Then insert it in your post http://screencast.com/t/nZtURMwx
It will show up like this: http://screencast.com/t/lUyEBULxH

It’s possible from code also, using the do_shortcode() function like this:
<?php echo do_shortcode('your shortcode') ?>

Thnaks

Lucian
tagDiv Staff

Hi,

Make sure you paste this code:

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

..in the loop-single.php file like this: http://screencast.com/t/doKMzVqf

Also remove the ad code from Your Article Top Ad in Theme Panel > Ads http://screencast.com/t/8bOrnSrSSk and put it in the Custom Ad 3 http://screencast.com/t/CPxv1iSrw

After you have done that add this custom CSS in Theme Panel > Custom CSS:

.post .td-a-rec-id-custom_ad_3 {
margin-top: 30px;
}

You will get this result: http://screencast.com/t/vBxKTZRqZq

Thanks

Lucian
tagDiv Staff

Hi,

Please add this code <?php echo do_shortcode('[td_ad_box spot_id="custom_ad_3"]'); ?> in the loop-single.php file like this: http://screencast.com/t/g9yorI3X
Also add this custom CSS in Theme Panel > Custom CSS:

.post .td-a-rec-id-custom_ad_3 {
margin-top: 30px;
}

If you want to be full width you can do it like this https://forum.tagdiv.com/topic/adsense-below-header-on-homepage/#post-15013 for each template you want the ad to be displayed.

Thanks

Lucian
tagDiv Staff

Hi,

Add this code:

$adcounter = 0;

and

$adcounter++;
    if (is_category() or is_archive()) {
        if ($adcounter == 2 or $adcounter == 4 or $adcounter == 6) {
        echo do_shortcode('[td_ad_box spot_id="custom_ad_1"]');
        }
    }

in the loop.php file, like this: http://screencast.com/t/DsXKbb9C

This will add an ad after 2 post, 4 post and 6 posts on the category page and archive page also if you want you can change this simply by removing or by adding $adcounter == variable or changing it’s value as you want. Also notice that the code for these ad goes in the Ads > Custom Ad 1 > Your Custom Ad 1 in Theme Panel.

You will also need to add this custom CSS in Theme Panel > Custom CSS:

.category .td-a-rec-id-custom_ad_1{
margin-bottom: 30px !important;
}

.archive .td-a-rec-id-custom_ad_1{
margin-bottom: 30px !important;
}

You will get this result: http://screencast.com/t/nuHrZ7zhGY

Thanks

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

Hi,

Do you want to add an ad above the content on post/page/category pages?
For post you can use the Top Article Ad from Theme Panel -> Ads
For Pages and Category Pages you need to add the ad directly in the template file using this:

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

In page.php file and category.php file
Hope this helps

Thanks

Lucian
tagDiv Staff

Hi,

Please follow this steps:

1. Using page builder add and configure “Social icons” and then switch to Classic Mode to get the shortcode like this http://screencast.com/t/QB6MexTB

2. Go to menu-header.php and replace the search icon with the following code like this: http://screencast.com/t/8H2XL18lRGr

<?php echo do_shortcode('Your Shortcode goes here'); ?>

Replace with your code like this: http://screencast.com/t/XOMIQbN1s

3. Inside the same menu-header.php file you have to change those classes like this:

…the one from the top to "span 9" http://screencast.com/t/3Kq6hyj0f and the one from the bottom to "span 3" like this http://screencast.com/t/J8nJjrVazN

4. Last add this custom CSS:

#td-top-search {
width: auto !important;
margin-left: 0px !important;
}

#td-top-search .td-social-wrap {
position: relative;
top: 10px;
}

…in Theme Panel -> Cutom CSS

Result: http://screencast.com/t/3WBgoKQ9j

Thanks

Lucian
tagDiv Staff

Hi,

Use a Custom Ad instead the Article Bottom Ad:

1. Go to Theme Panel -> Ads and move the Adsense code from Article Bottom Ad to Custom Ad 1 like this: http://screencast.com/t/FBuM88yc5

Replace the code for the ad in the single.php file with this one:

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

Then add this CSS in Theme Panel -> Cutom CSS:

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

Thanks

Lucian
tagDiv Staff

Hi,

Please add this code:

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

…to your single.php file like this: http://screencast.com/t/My2fHvSBj

Add this code in Theme Panel -> Custom CSS to move the ad box further from the diqus block:

.td-a-rec-id-content_bottom {
margin-top: 20px;
}

Should look like this: http://screencast.com/t/ZOFFoxhXNuB

Thanks

Lucian
tagDiv Staff

Hi,

Please disable the automaticaly display at the bottom of the post setting from nrelate plugin panel like this: http://screencast.com/t/bXpEDrWxFU
Then add this code:

<?php echo do_shortcode('[nrelate-related]'); ?>

..to your loop-single.php file like this: http://screencast.com/t/647C6yfu
Then you will be able to use your article bottom ad and it will be displayed above the nrelate plugin http://screencast.com/t/KjuW20OeFQ

Thank you

Emil G
tagDiv Staff

Hi,

1. You have to edit the td_module_blog.php and replace the following variable with the tags you want – http://screencast.com/t/ZIUaDZrAU

replace with:
array(15,12,30)

Where the numbers (15, 12, 30) are the tags ids. You can find the ids by hovering on the tabs – http://screencast.com/t/lW8v99kt

Don’t forget to set the by tag option in the Theme Panel – http://screencast.com/t/YOnaj81chh

2. You can replace the line inside the loop-single.php like this – http://screencast.com/t/zUxFfJSvHM
You can take the shortcode from the visual composer, create and set a block and switch to classic mode – http://screencast.com/t/tNlsx6vNDhttp://screencast.com/t/mVWFCVKX

do_shortcode('[add your shortcode here]');

3. Do you want to add a background to the module/widget h3 titles? please provide more details.

Thank you, Emil G.

Emil G
tagDiv Staff

Hi,

Do you refer to the Big Slide? If you do note that the big slider is not a part of the header, it’s under the header and yes, it is possible.
You just have to create the slider and add it on page using the visual composer Revolution Slider block element – http://screencast.com/t/2kO8gjrJ
If you want to replace it on Homepage BG templates you have to edit the template file and replace the Big Slider line with the Revolution Slider shortcode
http://screencast.com/t/oNDOhaCH3H
http://screencast.com/t/wte9CA0nj

echo do_shortcode(‘[rev_slider test]’);

Thank you, Emil G.

Lucian
tagDiv Staff

Hi,

You have to move the code you have added to the loop-single.php file to the single.php file, you will also need to add along with it another code like this: http://screencast.com/t/QUp9iiKE0Z

You have the code that you need to paste in the single.php file here:

 echo td_page_generator::wrap_start();
 echo do_shortcode('[vc_row][vc_column width="1/1"][td_ad_box spot_id="custom_ad_3"][/vc_column][/vc_row]');
 echo td_page_generator::wrap_end(); 

Keep in mind that you will need to the code that you have added in the loop-single.php file if you chose to paste it from here.

Thank you

Viewing 25 results - 1,026 through 1,050 (of 1,077 total)