- NewsmagAbove footer ads
- NewsmagSmart list ads
- NewsmagArticle ads
- NewsmagSidebar ads
- NewsmagHeader ads
- NewspaperHeader ads
- NewspaperSidebar ads
- NewspaperArticle Ad
- NewspaperPost template ads
- NewspaperAbove footer ads
I can’t get shortcodes to output content in image captions.
Is there something I need to put somewhere? I guess some code like > do_shortcode image_caption
I don’t know where and how to put it. It must be Newspaper theme related because it displays in the AMP version.
Hello,
You can try to implement a block under the comments section with infinite loading pagination but it will not be able to detect the current post viewed. The block will also include the current post as blocks were not meant to be displayed on posts by default.
Here is an example:
<?php echo do_shortcode('[vc_row][vc_column width="2/3"][td_block_3 limit="4" custom_title="More Articles" td_ajax_filter_type="" ajax_pagination="load_more"][/vc_column][vc_column width="1/3"][/vc_column][/vc_row]');?>
I have implemented it like so: https://www.screencast.com/t/r0Hy2JEYL8te
Hello,
Sorry but our theme does not have any such ad spot. IT can only be done by altering the php code for the post templates. You can use a do_shortcode function: https://developer.wordpress.org/reference/functions/do_shortcode/ like so:
<?php echo do_shortcode ('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
You have to place yur ad code in the custom ad 1 spot and it will show up where you place the do_shortcode function in the theme template files.
Thanks.
Hi,
I need some customization tips.
I want to place the meta info of a post below author name (between the name and the description) but I’m facing some difficulties because of the $buffy string.
For now I have this:
$buffy .= ‘<div class=”td-module-meta-info”>’;
$buffy .= the_time(‘d \d\e F \d\e Y’);
$buffy .= ‘-‘;
$buffy .= do_shortcode(‘[rt_reading_time label=”Leitura de” postfix=”minutos” postfix_singular=”minuto”]’);
$buffy .= ‘</div>’;
The shortcode works well but the time appears above the author box, for some reason. If I try to place the post views and comments it gives me a PHP error.
Tks
Hello,
The slider can only be added into pages or posts. The category templates cannot be edited with the tagdiv composer so you cannot add shortcodes to them except with custom php code if you are comfortable altering php files. You can use a do_shortcode function:
https://developer.wordpress.org/reference/functions/do_shortcode/ and place the revolution slider shortcode inside the function and then place it in the category template files: https://www.screencast.com/t/KYMkUxHej
Thank you!
Hello.
I would like to know if its possible instead of hardcoding the ad code in modules/templates etc to use an ad shortcode.
I have tried echo do_shortcode('[custom_ad_2]') for example, but thats not working.
Kind Regards
Hello ahmedyakub,
1)If you want to add more meta tags into our theme you should try using such a plugin with this functionality, like Seo Yoast plugin.
2)If you want to affect the post template by adding a table you should use a text with title element where you created your table and then, using the do_shortcode method you should add it in the post template you want. As a reference, you can check the following topic from here -> https://forum.tagdiv.com/topic/add-content-globally-to-bottom-of-each-post/
Thanks.
Hello gskitchen,
The theme does not have any such an option for Newsletter on posts but only for pages, sorry! If you want something like this, you should use the do_shortcode method to add the Newsletter section after each post. First of all, you should edit the Newsletter element on a page and then take the generated shortcode and add it t your post template using the do_shortcode method, just like here -> https://forum.tagdiv.com/topic/add-ad-under-related-article/ -> https://www.screencast.com/t/vVXH36fd6b and then, when you edit this page without TD Composer, in the backend you will see the generate shortcode for that element -> https://www.screencast.com/t/jM35ESEN which is needed to add in shortcode method. This is just a hint about what you have to do in this case.
Hope this helps!
Hello,
Our theme does have an article top ad spot, but it will not show up above the article title. It shows up below the title. If you need such an ad spot, it can only be made custom by altering the theme php files. Here is an example.
place an ad in the custom ad 1 spot and then use this code in the template file corresponding for the post style that you use:
<?php echo do_shortcode ('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
https://www.screencast.com/t/jHNqq4tKuu
Thanks.
-
This reply was modified 8 years by
Alin [tagDiv].
Hello
I am having that fatal error on AMP while browsing from safari on an iPhone:
Fatal error: Uncaught Error: Class ‘td_css_res_compiler’ not found in /home2/lebnanew/public_html/LibV8/wp-content/plugins/td-composer/includes/shortcodes/vc_row.php:171 Stack trace: #0 /home2/lebnanew/public_html/LibV8/wp-content/plugins/td-composer/includes/tdc_composer_block.php(133): vc_row->get_custom_css() #1 /home2/lebnanew/public_html/LibV8/wp-content/plugins/td-composer/includes/shortcodes/vc_row.php(324): tdc_composer_block->get_block_css(NULL, false) #2 /home2/lebnanew/public_html/LibV8/wp-content/themes/Newspaper/includes/wp_booster/td_global_blocks.php(28): vc_row->render(Array, ‘[vc_column widt…’) #3 /home2/lebnanew/public_html/LibV8/wp-includes/shortcodes.php(319): td_global_blocks::proxy_function(”, ‘[vc_column widt…’, ‘vc_row’) #4 [internal function]: do_shortcode_tag(Array) #5 /home2/lebnanew/public_html/LibV8/wp-includes/shortcodes.php(197): preg_replace_callback(‘/\\[(\\[?)(vc_row…’, ‘do_shortcode_ta…’, ‘<p>[vc_row][vc_…’) #6 /home2/lebnanew/public_html/LibV8/wp-includes/class-wp-hook.php(28 in /home2/lebnanew/public_html/LibV8/wp-content/plugins/td-composer/includes/shortcodes/vc_row.php on line 171
Any idea about how fixing it ?
Hello,
If you remove the code I pointed out, it will remove the comments. If you replace it with a plugin shortcode, then it will probably show the plugin comments but this is not tested so I cannot say for sure. You can use a do_shortcode function: https://developer.wordpress.org/reference/functions/do_shortcode/
Thank you!
Hello inapex,
Sorry but please notice that our theme does not have any such an option that allows you to add many ads to your category pages, unfortunately! You should do it through the code using the do_shortcode() method according to your category template used by you. Please check the following topic from here -> https://forum.tagdiv.com/topic/ads-on-category-pages/ because there was explained how you could add that thing. For more information about the is_category(categroy_ID) function, please consult here -> https://developer.wordpress.org/reference/functions/is_category/
Hope that help!
Thanks.
Hello,
If you want that to appear above the footer across all of the site, then you will have to alter the php files and implement it through a shortcode.
Place the code at the very top of the footer for the template that you use: https://www.screencast.com/t/5MbDwtOFWU
You can implement the shortcode using a do_shortcode function: https://developer.wordpress.org/reference/functions/do_shortcode/
Thank you!
Solved,
to automatic gallery i am insert this code <?php echo do_shortcode('[gallery]'); ?>
And edit td_wp_booster_functions.php
–> http://screencast.com/t/7Tz3x3mfh
Thankyou
Hello,
The code does not place the ad automatically after each module. You have to type it in manually as many times as you need. It is a manual process, not an automatic process. You only added 3 conditions as my example shows, placing the ad after 2 , 4 or 6 posts. You need to get a bit more creative if you need the ad to come up after a set number of posts every time.
As an example to make it show up after each 2 posts, you simply need a condition which checks the adcounter if it divides by 2 or not. so a solution would be
if($adcounter%2==0){
echo do_shortcode ...etc.
Thanks.
Will the solution outlined below work with this theme?
Here’s the code you can add to your theme’s “functions.php” file (or “custom_functions.php” on Thesis) to create a yellow box:
function make_yellowbox($atts, $content = null) {
return ‘<p style=”background: none repeat scroll 0 0 #ff9; clear: both; margin-bottom: 18px; overflow: hidden; border: 1px solid #e5e597;
padding: 13px;”>’ . do_shortcode($content) . ‘</p>’;
}
add_shortcode(‘yellowbox’, ‘make_yellowbox’);
Once the code it added, any text wrapped inside of this shortcode will appear in a yellow box.
[yellowbox]Here is the text in the yellow box[/yellowbox]
Hi,
I have wallpaper site.
I switch my theme to newspaper, gallery not show up.
I insert this code <?php echo do_shortcode('[gallery]'); ?> on single.php to showup images on my post (automaticaly)
But, if i click this image i will go to image url.
Can you tell me how i can show images, but if i click images. i will be go to attachment pages.
sorry with my english.
Thanks
Hello,
Our theme does not have any such ad spot. However, you can place an ad on a specific post template using a do_shortcode functions to call one of the ads in the theme panel ad spots. Here is an example where we call a custom ad 1 below the related articles on a post template:
code:
<?php echo do_shortcode ('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
https://www.screencast.com/t/DwoJ3XNhyvc
You will have to add the code in every post template corresponding to each post style that you use on your site.
Thank you!
Hi,
I recently installed the Ajax Load More plugin and purchased the Previous Post Add-on.
I would like to know if you have encountered any problems with this plugin, and what you suggest to install this shortcode inside the single template .php file (or if it should also be installed in the single loop or elsewhere).
Thank you
——- example ——-
<? php get_header (); ?>
<main id = “page-content”>
<div class = “post-container”>
<? Php
// The loop
if (have_posts ()):
while (have_posts ()): the_post ();
// replaced with Ajax Load More shortcode
echo do_shortcode (‘[ajax_load_more post_type = “post” repeater = “default” previous_post = “true” previous_post_id = “‘. get_the_ID (). ‘” posts_per_page = “1” button_label = “Previous Post”]’);
endwhile;
endif;
?>
</ Div>
</ Main>
<? php get_footer (); ?>
Hello,
In order to place a custom form in the heaeder, you will need to edit this file: https://www.screencast.com/t/sfW4xjdNppgT
You can use a do_shortcode function to render shortcodes.
https://developer.wordpress.org/reference/functions/do_shortcode/
Thank you!
Hi,
Could be a misunderstanding by my colleague, however there are solutions that you can try. By default that is not a theme ad spot, so ads cannot be displayed there. You could edit the post template and insert a do_shortcode in the location you want, inside the post structure
– https://forum.tagdiv.com/topic/single-post-how-to-place-a-horizontal-banner-right-below-the-sharing-buttons/
– https://forum.tagdiv.com/topic/how-can-i-put-ads-between-post-title-and-social-share-button/
– https://forum.tagdiv.com/topic/add-content-globally-to-bottom-of-each-post/
Hi,
@Amit That is not a theme ad spot. You could edit the template and insert a do_shortcode in the location you want
– https://forum.tagdiv.com/topic/single-post-how-to-place-a-horizontal-banner-right-below-the-sharing-buttons/
– https://forum.tagdiv.com/topic/how-can-i-put-ads-between-post-title-and-social-share-button/
– https://forum.tagdiv.com/topic/add-content-globally-to-bottom-of-each-post/
Hi,
I’m trying to implement AdSense’s new InFeed ads on my post pages between the related posts.
Is there a way to add the do_shortcode with custom ad block containing the InFeed adcode somewhere between the code in td_block_related_posts.php? I’ve been looking into that piece of code but it looks like a loop and I don’t know where to add the shortcode to display the InFeed ad between related posts.
Any help would be greatly appreciated!
Hello,
You can add the <?php echo do_shortcode(‘[google-translator]’); ?> part in the top bar template files: https://www.screencast.com/t/Yw32rUbl
Thank you!
Hi! Is there a way that I can put the google translator flags in TOP Bar?
A simple way would be to put the code in extra information using TopBar Multi-purpose, however the field is only for text and the code does not work.
Google Translator plugin codes:
For usage in pages/posts/sidebar: [google-translator]
For usage in header/footer/page templates: <?php echo do_shortcode(‘[google-translator]’); ?>
Thanks,
Larissa