Search Results for 'do_shortcode'

    No search results were found in Documentation!

Results from the Forum
Lucian
tagDiv Staff

Hi,

We haven’t tested the theme using any of those plugins so I can’t provide an accurate answer on this.
I suggest you also address the issues you have using them to plugins authors and make sure that you sue them right.

The theme already has a built in infinite scroll pagination for blocks which you can use to display your content and use the infinite scroll pagination feature.
You can configure a block to use the infinite scroll pagination and on templates on which you can’t use the page builder add the block shortcode inside the template where you need this.
Here is an example for using block 13 with infinite scroll pagination on single post page after the related posts section:

– use VC page builder to customize the block: http://screencast.com/t/MYIDubqBqFJ
– switch to classic mode and get the block shortcode: http://screencast.com/t/tymN00V7m
– add the shortcode to post template, you’d have to edit the loop-single.php template and add the block shortcode using the do_shortcode function, like this: http://screencast.com/t/Qod46BQhTZtt
* here is the code I’ve used: http://pastebin.com/yRjEcaD2
– the result: http://screencast.com/t/kcqFH6hM

Thansk

Alin [tagDiv]
tagDiv Staff

Hi,

If you want to place the ad in the post template please use the do_shortcode() function: http://screencast.com/t/aC3Y1kmdkht
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?>

Result: http://screencast.com/t/dAz3dCV4v

Also please post your issues in newsmag section – https://forum.tagdiv.com/forum/newsmag/

artcuddy
tagDiv Member

Just to add to this I’m using this shortcode <?php echo do_shortcode(‘[td_block_12 limit=”4″ custom_title=”More Stories” td_filter_default_txt=”All” ajax_pagination=”infinite”]’);?> at the bottom of the loop-single-2.php. I want to insert ads in this block after every 4 posts. Thanks

Alin [tagDiv]
tagDiv Staff

Hi,

Unfortunately this is not an easy task, I have tried with css but it cannot help because break the row: http://screencast.com/t/S7nl6Msw5q
I have managed to find a solution but your ad will be added to the bottom: http://screencast.com/t/ZTuap2iuFzjU
You have to add your custom ad like this in the loop.php file:
*add $adcounter = 0; like this: http://screencast.com/t/agBFQMJ8XjE
*also this code bellow end loop: http://screencast.com/t/WnNkAd4mGMit

$adcounter++;
if (is_category() && ($adcounter == 1)) {
echo do_shortcode('[td_ad_box spot_id="custom_ad_1"]');
}

Hope this helps!

Alin [tagDiv]
tagDiv Staff

Hi,

On Newspaper 5 will be added all Visual Composer features, for some of elements are hidden in functions.php and may not work properly. Also facebook like button is there and you can enable it if you need like this: http://screencast.com/t/fPmwaQRmtlThttp://screencast.com/t/uJZPWeIw
Also you can use do shortcode() to display it on search page and other templates.

do_shortcode('[vc_facebook]'); ?>

Also an easy solution may be to find a plugin to display social like buttons on other templates that post pages.

Hope this helps!

Miguel
tagDiv Member

When I do that, the ads look like this, not side by side, but one above the other: http://www.screencast.com/t/P1yfsvoaT6J5

And I want the ads like this: http://www.screencast.com/t/d5adyO8674y

The only way that i made that possible was with the code directly in the loop single, when i put the code in theme panel, with the command <?php echo do_shortcode(‘[td_ad_box spot_id=”custom_ad_1″]’); ?>
<?php echo do_shortcode(‘[td_ad_box spot_id=”custom_ad_2″]’); ?> the ads look like in the first image.

The problem is that with the code in loop single i can’t define just one ad in mobile.

Thanks!

Alin [tagDiv]
tagDiv Staff

Hi,

Please try to ad the code in Theme Panel like I suggested above as I cannot target to hide it with css code and use this code to echo it in loop single(sorry that I did not posted the code above):
<?php echo do_shortcode('[td_ad_box spot_id="custom_ad_1"]'); ?>
<?php echo do_shortcode('[td_ad_box spot_id="custom_ad_2"]'); ?>

Thanks!

Miguel
tagDiv Member

Problem solved, thanks a lot! I had to put directly the html code for the ads in loop-single.php, in the same spot you told me to put <?php echo do_shortcode(‘[td_ad_box spot_id=”custom_ad_1″]’); ?> because it wasn’t working.

Once again thanks a lot!

Lucian
tagDiv Staff

Hi,

Unfortunately the category page template can’t be built via VC page builder therefore you can’t use blocks there as blocks can be added via page builder only or as widgets on sidebars.
You could do this by alter the category template and adding a condition as “when category X is called” your custom layout and blocks load instead of the loop posts or besides them. You can use the do_shortcode() functions to add the block on the category page and customize them via VC page builder.
Other way would be to use the page builder and create the page using VC then add a menu item and set the custom page to it.
Either way this would not be easy and you’d need custom modifications to theme’s code so I suggest you get a freelancer or hire a developer to do this for you if you don’t know how to do it by yourself.

Thanks

linearwhiz
tagDiv Member

Did it by adding this code to the end of single.php before the php closing tag :-

echo td_page_generator::wrap_start();
echo do_shortcode(‘[vc_row][vc_column width="2/3"][td_block3 sort=”random_posts” limit=”10″ custom_title=”Trending” ajax_pagination=”infinite”][/vc_column][vc_column width="1/3"][/vc_column][/vc_row]‘);
echo td_page_generator::wrap_end();

simchris
tagDiv Member

I jumped from 1.4 to 1.6 — so still “discovering” some things also 🙂

For tags … I think there is a better plugin for doing tags, frankly. Somebody else had example of this earlier this week .. where they were nice little tags with nicer styling. I think you have to use either plugin, or add something to functions file to limit number of tags.

Hmmm. Could not find a function over ride for that.

On our old site we actually hooked that manually either via shortcode or placing the call directly in the area….

e.g.,

<?php wp_tag_cloud('smallest=8&largest=36&order=RAND&number=75'); ?>

http://codex.wordpress.org/Template_Tags/wp_tag_cloud

———–
convoluted
https://wordpress.org/plugins/tag-cloud-shortcode/faq/

add short code to any text widget- edit for functions.php
add_filter('widget_text', 'do_shortcode');

———-

I was just trying to do this myself, Then decided to just use in sidebar. Then decided to do something else as my brain was hurting ….

———-

possible simple plugin widget (have not yet tried)
https://wordpress.org/plugins/f2-tag-cloud-widget/

Lucian
tagDiv Staff

Hi,

You can use the custom ad 1 spot or other and add it to the post template using the do_shortcode() function and edit your post template file that you use and add this short-code: http://screencast.com/t/pGq99wqKHpe

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

You can find the short-codes for other ad spots here: https://forum.tagdiv.com/ads/

Thanks

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

Hi,

The theme’s system detect’s and renders the following ad codes:

Google adSense – If you enter a google adsense code, the theme will make it responsive and the ad will fill the available space.
Simple ad code (js/flash/images) – this is rendered as entered by the user
[shortcodes] – the spot will run do_shortcodes() on the ad. Using shortcodes you can add adRotate ads to that spot.

Not sure if your js ads are working but you could give them a try. You could also try to use a plugin to display your ads.

Thanks

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

Hi,

You can try to edit your archive template and use short-codes and the do_shortcode function to add blocks built and customized using VC page builder.
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
If you don’t know how to do it I suggest you get someone to help you with this as we cannot do custom modification at the moment.

Thanks

Lucian
tagDiv Staff

Hi,

Unfortunately as you know you can use page builder on category pages therefore you can’t add blocks on it.
You can try to achieve this using the do_shortcode function and built and customize the block you want via VC page builder then using the shortcode function add it to your category page template after the loop.
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

Thanks

keypractices
tagDiv Member

Is this because of the galleries being set up in Jetpack but not available anymore?

[04-Mar-2015 10:00:51 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1 for query SELECT * FROM wp_fsg_galleries WHERE fsg_id= made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/Newsmag/single.php’), td_api_single_template::_helper_show_single_template, load_template, require_once(‘/themes/Newsmag/single_template_3.php’), locate_template, load_template, require_once(‘/themes/Newsmag/loop-single-3.php’), td_module_single_base->get_content, apply_filters(‘the_content’), call_user_func_array, do_shortcode, preg_replace_callback, do_shortcode_tag, call_user_func, fsg_shortcode_renderer, make_gallery_html
[04-Mar-2015 15:21:02 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1 for query SELECT * FROM wp_fsg_galleries WHERE fsg_id= made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/Newsmag/single.php’), td_api_single_template::_helper_show_single_template, load_template, require_once(‘/themes/Newsmag/single_template_3.php’), locate_template, load_template, require_once(‘/themes/Newsmag/loop-single-3.php’), td_module_single_base->get_content, apply_filters(‘the_content’), call_user_func_array, do_shortcode, preg_replace_callback, do_shortcode_tag, call_user_func, fsg_shortcode_renderer, make_gallery_html

keypractices
tagDiv Member

Now I can’t even disable plugins to log into Admin – i am getting these errors

/home3/redcarp8/public_html/error_log:
[04-Mar-2015 02:29:59 UTC] PHP Fatal error: require_once(): Failed opening required ‘/home3/redcarp8/public_html/wp-content/plugins/js_composer/include/classes/shortcodes/shortcodes.php’ (include_path=’.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear’) in /home3/redcarp8/public_html/wp-content/plugins/js_composer/include/classes/core/class-vc-base.php on line 243
[04-Mar-2015 02:30:44 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /home3/redcarp8/public_html/wp-content/themes/Newsmag/includes/wp_booster/td_block.php on line 63
[04-Mar-2015 02:31:06 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home3/redcarp8/public_html/wp-includes/taxonomy.php on line 2156
[04-Mar-2015 02:31:20 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home3/redcarp8/public_html/wp-content/themes/Newsmag/includes/wp_booster/td_block.php on line 64
[04-Mar-2015 02:31:26 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /home3/redcarp8/public_html/wp-content/themes/Newsmag/includes/wp_booster/td_block.php on line 62
[04-Mar-2015 02:31:38 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /home3/redcarp8/public_html/wp-includes/wp-db.php on line 1981
[04-Mar-2015 02:31:43 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home3/redcarp8/public_html/wp-includes/taxonomy.php on line 2664
[04-Mar-2015 02:31:53 UTC] PHP Warning: require_once(/home3/redcarp8/public_html/wp-content/plugins/js_composer/include/classes/shortcodes/shortcodes.php): failed to open stream: No such file or directory in /home3/redcarp8/public_html/wp-content/plugins/js_composer/include/classes/core/class-vc-base.php on line 243
[04-Mar-2015 02:31:53 UTC] PHP Fatal error: require_once(): Failed opening required ‘/home3/redcarp8/public_html/wp-content/plugins/js_composer/include/classes/shortcodes/shortcodes.php’ (include_path=’.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear’) in /home3/redcarp8/public_html/wp-content/plugins/js_composer/include/classes/core/class-vc-base.php on line 243
[04-Mar-2015 02:38:57 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home3/redcarp8/public_html/wp-content/themes/Newsmag/includes/wp_booster/td_block.php on line 64
[04-Mar-2015 02:39:03 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home3/redcarp8/public_html/wp-includes/taxonomy.php on line 2662
[04-Mar-2015 02:39:10 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home3/redcarp8/public_html/wp-content/themes/Newsmag/includes/wp_booster/td_block.php on line 62
[04-Mar-2015 02:39:20 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home3/redcarp8/public_html/wp-content/themes/Newsmag/includes/wp_booster/td_block.php on line 63
[04-Mar-2015 02:39:21 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /home3/redcarp8/public_html/wp-content/themes/Newsmag/includes/wp_booster/td_block.php on line 63
[04-Mar-2015 02:39:24 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /home3/redcarp8/public_html/wp-includes/taxonomy.php on line 2157
[04-Mar-2015 02:39:31 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home3/redcarp8/public_html/wp-content/themes/Newsmag/includes/wp_booster/td_block.php on line 63
[04-Mar-2015 02:39:31 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home3/redcarp8/public_html/wp-includes/taxonomy.php on line 2107
[04-Mar-2015 02:39:38 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 64 bytes) in /home3/redcarp8/public_html/wp-content/themes/Newsmag/includes/wp_booster/td_block.php on line 63
[04-Mar-2015 02:39:39 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 64 bytes) in /home3/redcarp8/public_html/wp-includes/wp-db.php on line 1981
[04-Mar-2015 02:40:00 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 12288 bytes) in /home3/redcarp8/public_html/wp-content/themes/Newsmag/includes/block_templates/td_block_template_1.php on line 77
[04-Mar-2015 02:40:21 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home3/redcarp8/public_html/wp-includes/wp-db.php on line 1975
[04-Mar-2015 02:40:26 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 64 bytes) in /home3/redcarp8/public_html/wp-content/themes/Newsmag/includes/wp_booster/td_block.php on line 63
[04-Mar-2015 02:40:28 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 114 bytes) in /home3/redcarp8/public_html/wp-includes/plugin.php on line 108
[04-Mar-2015 02:40:38 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home3/redcarp8/public_html/wp-content/themes/Newsmag/includes/wp_booster/td_block.php on line 63
[04-Mar-2015 02:40:44 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home3/redcarp8/public_html/wp-includes/taxonomy.php on line 2156
[04-Mar-2015 02:49:18 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8388608 bytes) in /home3/redcarp8/public_html/wp-content/plugins/wordfence/lib/wfBrowscap.php on line 87
[04-Mar-2015 02:49:34 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8388608 bytes) in /home3/redcarp8/public_html/wp-content/plugins/wordfence/lib/wfBrowscap.php on line 87
[04-Mar-2015 02:49:48 UTC] PHP Fatal error: require(): Failed opening required ‘wfBrowscapCache.php’ (include_path=’.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear’) in /home3/redcarp8/public_html/wp-content/plugins/wordfence/lib/wfBrowscap.php on line 87
[04-Mar-2015 10:00:51 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1 for query SELECT * FROM wp_fsg_galleries WHERE fsg_id= made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/Newsmag/single.php’), td_api_single_template::_helper_show_single_template, load_template, require_once(‘/themes/Newsmag/single_template_3.php’), locate_template, load_template, require_once(‘/themes/Newsmag/loop-single-3.php’), td_module_single_base->get_content, apply_filters(‘the_content’), call_user_func_array, do_shortcode, preg_replace_callback, do_shortcode_tag, call_user_func, fsg_shortcode_renderer, make_gallery_html
[04-Mar-2015 15:21:02 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1 for query SELECT * FROM wp_fsg_galleries WHERE fsg_id= made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/Newsmag/single.php’), td_api_single_template::_helper_show_single_template, load_template, require_once(‘/themes/Newsmag/single_template_3.php’), locate_template, load_template, require_once(‘/themes/Newsmag/loop-single-3.php’), td_module_single_base->get_content, apply_filters(‘the_content’), call_user_func_array, do_shortcode, preg_replace_callback, do_shortcode_tag, call_user_func, fsg_shortcode_renderer, make_gallery_html

Alin [tagDiv]
tagDiv Staff

Hi,

Sorry for this, the screenshot from above I believed that is a page.
So if you need an add above comments on posts please add your code in Theme Panel > ADS > Custom AD 1: http://screencast.com/t/0F6qFnW9 and edit your post template file that you use and add this shortcode: http://screencast.com/t/fzthuQLKup

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

Result: http://screencast.com/t/jP9vbfkPWcor

Thanks!

Lucian
tagDiv Staff

Hi,

Unfortunately you’d have to edit the 404.php template file and customize it. You can’t use the page builder to customize it but you could use the do_shortcode function to add blocks/widgets created using the VC page builder.
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
You can use the orderby parameter to set the sort order you want: http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters ..here: http://screencast.com/t/d8W1lnm6gle

Thanks

Alin [tagDiv]
tagDiv Staff

Hi,

1. Please try this custom css:

.post footer{
margin-top: 0;
}

2. Please provide a link, so I can inspect this. If your plugin has a shrtcode you can add it in post template that you use in footer section: http://screencast.com/t/urkpnA0g9K

do_shortcode('[your shortcode]'); ?>

Thanks!

Alin [tagDiv]
tagDiv Staff

Hi,

You can add your banner code in Ads > Custom Ad1: http://screencast.com/t/5cU3h2Vo and use shortcode in header.php file: http://screencast.com/t/QthH04yzqh

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

Please use css for margin, in Theme Panel > Custom Css: http://screencast.com/t/Vqti384e2hy

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

Result: http://screencast.com/t/GtSeepg6DyO

Thanks!

Alin [tagDiv]
tagDiv Staff

Hi,

Add this code in loop-single.php above featured image: http://screencast.com/t/RVmFcvkV

<?php $page = get_query_var('page');
            if ($page < 2) {
                echo do_shortcode('[td_ad_box spot_id="header"]');
            }?>

And use this css: http://screencast.com/t/p6b7wtv6VrC

 .td-post-content .td-a-rec.td-a-rec-id-header{
top: auto;
left: auto;
margin-bottom: 30px;
} 

Thanks!

linearwhiz
Participant
#0

Hey Guys,

I am using pagination for my posts , and using the default template loop-single.php

what I would like to achieve is to have a piece of code for header Ad ( <?php echo do_shortcode(‘[td_ad_box spot_id=”header”]’); ?> ) to only show on the first page above the featured image , and I don’t want it to show on the second and third pages (where the featured image doesn’t show) …

so basically I want to tie up the header Ad to show and hide with the featured image ..

Again , I am using the default post Template and happy to play with code if you provide me with guidance ..

Cheers

Wissam

Alin [tagDiv]
tagDiv Staff

Hi,

I’m sorry I forgot to tell you to delete comments line. If you want to have comments above Big Grid please edit like this: http://screencast.com/t/BlYCNb8eWs
If you want to leave comments above Big Grid you can paste only Big Grid shortcode (that you figured out): http://screencast.com/t/t2Af1FqNZ

I’m not sure if this is the issue, but you can add an extra class to container div(post-grid) like this:

<div class="td-container post-grid">
      <div class="td-container-border">
            <div class="td-pb-row">
                 <?php
                 echo do_shortcode('[td_block_big_grid]');
                 ?>
            </div>
      </div>
</div>

And use this css: http://screencast.com/t/Y6a9eVGw9

.post-grid{
padding-left:1px;
}

Hope this helps!

MikeH
tagDiv Member

Soooo close. For some reason it still shows just below the breadcrumbs, but I think we’re ok with that.
Just in case they change their mind, do I need to change something else so the breadcrumbs are underneath?

Thanks again!

<?php
/**
* The single post loop - This shows only one post
**/

if (have_posts()) {
the_post();

$td_mod_single = new td_module_1($post);

echo do_shortcode('[td_ad_box spot_id="custom_ad_1"]');
//show the breadcrumb
if (get_post_type($post) == 'post') {
echo td_page_generator::get_single_breadcrumbs($td_mod_single->title);
} else {
echo td_page_generator::get_page_breadcrumbs($td_mod_single->title);
}
?>

Viewing 25 results - 926 through 950 (of 1,077 total)