- NewsmagAbove footer ads
- NewsmagSmart list ads
- NewsmagArticle ads
- NewsmagSidebar ads
- NewsmagHeader ads
- NewspaperHeader ads
- NewspaperSidebar ads
- NewspaperArticle Ad
- NewspaperPost template ads
- NewspaperAbove footer ads
Hi,
So you want to add a revolution slider in the mobile theme homepage? You can do that, the slider shortcode can be entered in the mobile editor which appears in the page edit screen
– https://www.screencast.com/t/VgOkSnGNH
– https://www.screencast.com/t/wl4DV430wn
It will appear between the top grid and the latest articles section
– https://www.screencast.com/t/nYOxP1ac033
The only way to make it appear below the latest articles would be to enter it in the mobile theme front page code directly
– https://www.screencast.com/t/qIvzoLSjSqRJ
– https://www.screencast.com/t/R5rZYlKp
<?php echo do_shortcode('shortcode here');?>
Thanks
Hi,
First, Congrats for this awsome Newspaper theme.
Fantastic!
This support forum was also very helpful for tweaking it.
here’s my problem:
1- I can’t figure out how to add a block 3colons*3lines for my best articles after an article “smartlist6”.
see image

Please can you help?
2- Does Next/Back button appear the same in mobile devices?
I noticed the amp version of my article doesn’t work: ie it doesn’t show the back/next button
Should I de-activate the Amp Newspaper plugin to make it work on mobiles?
What is the cost of de-activating the Amp plugin? (speed? seo? )
For info : here is my modified smartlist6 file
—-
<?php
class td_smart_list_6 extends td_smart_list {
protected $use_pagination = true; // set this to true to use rela pagination on this template
protected function render_before_list_wrap() {
if(td_global::$cur_single_template_sidebar_pos == ‘no_sidebar’) {
$td_class_nr_of_columns = ‘ td-3-columns ‘;
} else {
$td_class_nr_of_columns = ‘ td-2-columns ‘;
}
$buffy = ”;
//wrapper with id for smart list wrapper type 2
$buffy .= ‘<div class=”td_smart_list_6’ . $td_class_nr_of_columns . ‘”>’;
return $buffy;
}
protected function render_list_item($item_array, $current_item_id, $current_item_number, $total_items_number) {
//print_r($item_array);
$buffy = ”;
//creating each slide
$buffy .= ‘<div class=”td-item”>’;
$buffy .= ‘<div class=”td-number-and-title”><h2><span class=”td-sml-current-item-nr”>’ . $current_item_number. ‘</span><span class=”td-sml-current-item-title”>’ . $item_array[‘title’] . ‘</span></h2></div>’;
// 2nd ad smart list 6 Modif LJMI 1/12/2018
$buffy .= do_shortcode(‘[td_block_ad_box spot_id="custom_ad_1"]‘);
//get image info
$first_img_all_info = td_util::attachment_get_full_info($item_array[‘first_img_id’]);
//get image link target
$first_img_link_target = $item_array[‘first_img_link_target’];
//image caption
$first_img_caption = $item_array[‘first_img_caption’];
//image type and width – used to retrieve retina image
$image_type = ‘td_696x0’;
$image_width = ‘696’;
if(td_global::$cur_single_template_sidebar_pos == ‘no_sidebar’) {
$first_img_info = wp_get_attachment_image_src($item_array[‘first_img_id’], ‘td_1068x0’);
//change image type and width – used to retrieve retina image
$image_type = ‘td_1068x0’;
$image_width = ‘1068’;
} else {
$first_img_info = wp_get_attachment_image_src($item_array[‘first_img_id’], ‘td_696x0’);
}
if (!empty($first_img_info[0])) {
//retina image
$srcset_sizes = td_util::get_srcset_sizes($item_array[‘first_img_id’], $image_type, $image_width, $first_img_info[0]);
// class used by magnific popup
$smart_list_lightbox = ” td-lightbox-enabled”;
// if a custom link is set use it
if (!empty($item_array[‘first_img_link’]) && $first_img_all_info[‘src’] != $item_array[‘first_img_link’]) {
$first_img_all_info[‘src’] = $item_array[‘first_img_link’];
// remove the magnific popup class for custom links
$smart_list_lightbox = “”;
}
$buffy .= ‘
<figure class=”td-slide-smart-list-figure td-slide-smart-list-6’ . $smart_list_lightbox . ‘”>
</figure>
<figcaption class=”td-sml-caption”><div>’ . $first_img_caption . ‘</div></figcaption>
‘;
}
$tds_smart_list_6_title = td_util::get_option(‘tds_smart_list_6_title’);
//adding description
if(!empty($item_array[‘description’])) {
$buffy .= ‘<span class=”td-sml-description”>’ . $item_array[‘description’] . ‘</span>’;
}
// ad smart list 6 Modif LJMI30/11/2018 inversed text and Image
$buffy .= td_global_blocks::get_instance(‘td_block_ad_box’)->render(array(‘spot_id’ => ‘smart_list_6’, ‘spot_title’ => $tds_smart_list_6_title));
$buffy .= ‘</div>’;
// render the pagination
$buffy .= $this->callback_render_pagination();
//$buffy .= $this->callback_render_drop_down_pagination();
return $buffy;
}
protected function render_after_list_wrap() {
$buffy = ”;
$buffy .= ‘</div>’; // /.td_smart_list_6 wrapper with id
return $buffy;
}
}
——-
Hi,
If you want to add some ads through your category pages, you need to use the do_shortcode() function and add it through the theme’s core files. Check the following topic from here -> https://forum.tagdiv.com/topic/ads-on-category-pages/
Thanks for your understanding!
Hi Berbi,
If you want to add some ads through your category pages, you need to use the do_shortcode() function and add it through the theme’s core files. Check the following topic from here -> https://forum.tagdiv.com/topic/ads-on-category-pages/
Thanks for your understanding!
Hi
I’ve inserted a grid from Essential Grid. Grid is ok but the navigation menu (custom positin – in widget) is not working.
I’m applying this procedure:
https://www.themepunch.com/essgrid-doc/navigation-styles-position/
I’ve inserted this code into the functions.php too
add_filter(‘widget_text’, ‘do_shortcode’);
But it still is’t working. Please help..
Hello akshem,
Unfortunately, the theme has not been tested with this such a plugin, sorry! Also, notice that we cannot provide support for untested plugins, sorry! You need to edit the theme core files (loop-single) and add the shortcode for your ads, using the do_shortcodes(). -> https://www.screencast.com/t/XzzcYKxeL You can check the example topic here -> https://forum.tagdiv.com/topic/dfp-banner-ads-on-specific-categories/
Thanks for your understanding!
Hello @Catalin, unfortunately you have missed a comment change on https://www.screencast.com/t/dE9kgZKp6
You need to add to that screen: comment
/*if ( ! ( td_util::tdc_is_live_editor_iframe() || td_util::tdc_is_live_editor_ajax() ) ) {
$content = do_shortcode( shortcode_unautop( $content ) );
}*/
The changes suggested on 3 files, two on plugin “td-composer” and one on parent theme shortcodes folder seems to be working as expected. This files will be changed on plugin and theme next update?
Thank you. I’ll change my rating on TF.
Hello
Thanks, I success to have custom ads on default loop, archive, tag and category after 3 posts. this will be great if we can place custom ads on block for various customization in tagdiv composer.
I do some experiment to place custom ads on block 18. I put this code:
//insert adsense
$adcounter++;
if ($adcounter == 2 or $adcounter == 4 or $adcounter == 6){
$buffy .= do_shortcode('[td_block_ad_box spot_id="custom_ad_2"]');
}
On this file http://www.screencast.com/t/pmWcAIXu the custom ads show up on the block 18 after 2, 4 and 6 from posts lists http://www.screencast.com/t/wsT6hLeT. Also see live result is perfect http://www.screencast.com/t/5Ta26Pjoy. But the code is still not perfect, it’s because I can’t access tagdiv composer anymore hahaha http://www.screencast.com/t/sNKNE1u1o
It would be better if someone volunteered to help me to make this code works on the block 18 file. If this code is working, we can put custom ads in another block file. 🙂
Hello
Thank you for your response, yes I understand, I already find what I need from the old post on this forum. I just use this code on loop.php http://screencast.com/t/rG7rDLmRrTD for latest articles and category.
$adcounter++;
if (is_home()) {
if ($adcounter == 4 or $adcounter == 9) {
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_3"]');
}
}
$adcategory++;
if (is_category()) {
if ($adcategory == 5 or $adcategory == 10) {
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_3"]');
}
}
Thank you, this is great theme, I hope in the future there will be a new ads feature on newspaper theme.
Best regards. 🙂
Hello Catalin,
thank you for your reply.. this is not working
<?php echo do_shortcode (‘[td_block_1]‘); ?>
i have added the code as you said to loop-single-1.php but its not doing anything..
other option : to add the shortcode to post builder is working, but thats not the way we want to do it.
as we using childtheme is there a option to add the code
<?php echo do_shortcode (‘[td_block_1]‘); ?>
for every post using functions.php
cheers
jan
Hello jk,
Unfortunately, the theme does not have any such an option that allows you to do something like this, sorry! If you want to edit the post structure, you can add the block shortcode under the post content inside the Post editor, when you edit the post, like this -> https://www.screencast.com/t/oCLtfowE79 and the result looks like this -> https://www.screencast.com/t/x9sssnUZwrb or another alternative in this case would be to edit the post template and add this rule for all the posts which uses a certain post template. (use the do_shortcode()). -> https://www.screencast.com/t/aNXkJGSVPL2z
Thanks for your understanding!
Hi,
I need help please, i want to hide some post content on mobile devices, so i tried to do it by the Backend Editor but didn’t work for me
I got this :
Fatal error: Uncaught Error: Class ‘td_css_res_compiler’ not found in /home3/wahxjo0aezwi/public_html/wp-content/plugins/td-composer/includes/shortcodes/vc_row.php:171 Stack trace: #0 /home3/wahxjo0aezwi/public_html/wp-content/plugins/td-composer/includes/tdc_composer_block.php(133): vc_row->get_custom_css() #1 /home3/wahxjo0aezwi/public_html/wp-content/plugins/td-composer/includes/shortcodes/vc_row.php(324): tdc_composer_block->get_block_css(NULL, false) #2 /home3/wahxjo0aezwi/public_html/wp-content/themes/Newspaper/includes/wp_booster/td_global_blocks.php(28): vc_row->render(Array, ”) #3 /home3/wahxjo0aezwi/public_html/wp-includes/shortcodes.php(319): td_global_blocks::proxy_function(”, ”, ‘vc_row’) #4 [internal function]: do_shortcode_tag(Array) #5 /home3/wahxjo0aezwi/public_html/wp-includes/shortcodes.php(197): preg_replace_callback(‘/\\[(\\[?)(vc_row…’, ‘do_shortcode_ta…’, ‘<p><!– BEGIN T…’) #6 /home3/wahxjo0aezwi/public_html/wp-includes/class-wp-hook.php(286): do_shortcode(‘<p><!– BEGIN T…’) #7 /home3/w in /home3/wahxjo0aezwi/public_html/wp-content/plugins/td-composer/includes/shortcodes/vc_row.php on line 171
Hello, I’ve been using the echo do_shortcode for a long time to create custom galleries in my site. But I just noticed it’s not working anymore. What I do is to call the images and text from custom fields, then using:
echo do_shortcode(‘[gallery td_select_gallery_slide="slide" size="full" td_gallery_title_input="'. get_the_title() .'" ids="'. $images .'"]‘);
where $images is an array of image IDs. It renders a gallery, but the default WordPress one. Is there any script I should be loading along this code?
Hello,
I’m currently using module 10 for loop posts, categories, and tags. and I have set up in the loop.php that ads get display every 3, 6 and 9 posts. Here is the code that I’m using:
if (have_posts()) {
while ( have_posts() ) : the_post();
$adcounter++;
echo $td_template_layout->layout_open_element();
if (class_exists($td_module_class)) {
$td_mod = new $td_module_class($post);
echo $td_mod->render();
if (is_category() or is_tag() or is_home() or is_archive()) {
if ($adcounter ==3) {
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_3"]');
}
}
if (is_category() or is_tag() or is_home() or is_archive()) {
if ($adcounter ==6) {
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_2"]');
}
}
if (is_category() or is_tag() or is_home() or is_archive()) {
if ($adcounter ==9) {
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_2"]');
}
}
} else {
td_util::error(__FILE__, 'Missing module: ' . $td_module_class);
}
echo $td_template_layout->layout_close_element();
$td_template_layout->layout_next();
endwhile; //end loop
echo $td_template_layout->close_all_tags();
} else {
This is working with no problem. My issue is when I create a category template using the cloud library and I add the loop posts, the categories pages don’t show the ads within 3,6 or 9 posts. Is there anything that I need to add on the code above?
Thank you for your time,
Juan
Adding the lines
add_filter( ‘the_excerpt’, ‘shortcode_unautop’);
add_filter( ‘the_excerpt’, ‘do_shortcode’);
in the theme’s functions.php file doesn’t seem to work anymore. I would like to add a shortcode from TablePress but only the code text is shown, e.g., [table id=16 /]
OK,
You want to change the specific template, not the general loop.php file. Here is an example for the pages using the pagebuilder+ latest articles
https://www.screencast.com/t/GnN0dpMFIO
You have to use a do_shortcodes function.
There is a case for each sidebar position so you have to place the code inside the main content container for the case you use or each of the cases if needed.
Result: https://www.screencast.com/t/kUKxHEbebnQ
Thank you!
Hi,
You want to add widgets in the theme header? What widgets would those be exactly? If those are composer elements you could add them by shortcode
– https://forum.tagdiv.com/search/do_shortcode/
Thanks
I tried that like this – https://www.screencast.com/t/vucdgeVb
Result – https://www.screencast.com/t/pyn9sJAOnX
Code used
do_shortcode ('[td_block_ad_box spot_id="custom_ad_2"]')
Hi Bogdan,
We implemented the change, exactly as instructed with the category_id we want, check below
<?php echo do_shortcode('[td_block_big_grid_mob_1 sort="featured" category_id="1" ]'); ?>
And the mobile template simply omitted the big grid.
We tested other categories but no success. Any other idea?
Thank you!
Am trying to add php code to single post.
<?php echo do_shortcode(‘[mashshare]’); ?>
But it not working.
So below the header and above the page content. By using the page builder you can design any page with the content you want. If you want that section to be displayed on every page of the website (posts, categories etc) you could include it in the header template you are using maybe. Use the shortcode of the elements you want. Example with a block
– https://www.screencast.com/t/sDQyDAtC
– https://www.screencast.com/t/c5D8VynHx
– https://www.screencast.com/t/HJAUVEYy
– https://www.screencast.com/t/0UwGJGHE4
<?php echo do_shortcode('Shortcode here'); ?>
Other than this there would be no way I can think of to do what you are trying to.
Hi I’m also having this issue. I have removed td plugin, deactivated all plugins.
tried reinstalling.
Fatal error: Uncaught Error: Call to undefined method td_block_1::get_all_atts() in /home/deniseal/public_html/lovingthemouse.net/wp-content/themes/Newsmag 2/includes/shortcodes/td_block_1.php:135 Stack trace: #0 /home/deniseal/public_html/lovingthemouse.net/wp-content/themes/Newsmag 2/includes/shortcodes/td_block_1.php(111): td_block_1->inner(Array) #1 /home/deniseal/public_html/lovingthemouse.net/includes/wp_booster/td_global_blocks.php(28): td_block_1->render(Array, ”) #2 /home/deniseal/public_html/lovingthemouse.net/wp-includes/shortcodes.php(319): td_global_blocks::proxy_function(Array, ”, ‘td_block_1’) #3 [internal function]: do_shortcode_tag(Array) #4 /home/deniseal/public_html/lovingthemouse.net/wp-includes/shortcodes.php(197): preg_replace_callback(‘/\\[(\\[?)(td_blo…’, ‘do_shortcode_ta…’, ‘<p>[vc_row][vc_…’) #5 /home/deniseal/public_html/lovingthemouse.net/wp-includes/class-wp-hook.php(286): do_shortcode(‘<p>[vc_row][vc_…’) #6 /home/deniseal/public_html/lovingthemouse.net/wp-includes/plugin.php(203): W in /home/deniseal/public_html/lovingthemouse.net/wp-content/themes/Newsmag 2/includes/shortcodes/td_block_1.php on line 135
Just adding to the above to show you what I did.
<div class="td-container">
<?php echo do_shortcode('[td_block_big_grid_mob_1 sort="featured"]'); ?>
to
<div class="td-container">
<?php echo do_shortcode('[td_block_big_grid_mob_1 sort="rand"]'); ?>
Hello,
You can implement your widget using a do_shortcode function in the theme post template files or by adding it on a new post tmepalte using the cloud library plugin. You can add the shortcode on the post template in a column text element. Please use this guide to import a post style from the cloud templates and to edit it in the tagdiv composer: https://forum.tagdiv.com/tagdiv-cloud-library-plugin/
Thank you!
hello, i want to learn about shortcode.
where can i read it?
I want to know, anything related to [gallery] (title, size, and much more..)
<?php echo do_shortcode('[gallery]'); >?
Thank You
Lutfi