- NewsmagPage templates
Is any way to have <Hide featured post> option (as a filter) in Flexy Blocks? (Like in <post loop settings> from <pagebuilder+latest+pagination>??)
Hi Bogdan, I havenât migrated to tagDiv composer thing yet as it got me into issues last time when I migrated from NP7 to NP8 so I never enabled it in NP9. Is it possible to do it w/o tagDiv composer but rather with a coding in single.php or loop-single.php to insert block-5 section with a list of post IDs?
This is the continuation from the discussion from https://themeforest.net/item/newspaper/5489609/comments?page=775&filter=all#comment_20502207
Let me know.
Thanks.
Hey Catalin,
thanks for your reply. Im AWARE that these are 2 different things. And as i wrote its working for me. The only thing i want from you guys is a php code snipped which i can put into my new page-template to show the author box + item scope meta tags on the page w that template.
I dont care if its not pefect codewise or if i cant use your backand funktions on that particular page-template that i have copy+pasted from the post-template-7. it looks as i want it on the front end and google can flawlessly read it – enough for me.
What i dont want is to build or check other templates whith editior … it would just take me hours to get a result thats allready there in your post-template-7.
<?php
/* Template Name: Page+Mainimage */
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);
$td_post_featured_image = td_util::get_featured_image_src($post->ID, 'full');
if (!empty($td_post_featured_image)) {
td_js_buffer::add_to_footer(
'jQuery(window).ready(function() {' . "\r\n" .
'(function(){' . "\r\n" .
'var td_backstr_item = new tdBackstr.item();' . "\r\n" .
'td_backstr_item.wrapper_image_jquery_obj = jQuery( "#td-full-screen-header-image" );' . "\r\n" .
'td_backstr_item.image_jquery_obj = td_backstr_item.wrapper_image_jquery_obj.find( \'img:first\' );' . "\r\n" .
'tdBackstr.add_item( td_backstr_item );' . "\r\n" .
"jQuery('.td-read-down a').click(function(event){" . "\r\n" .
"event.preventDefault();" . "\r\n" .
"var header_wrap = jQuery( '.td-full-screen-header-image-wrap:first' )" . "\r\n" .
"if ( 1 === header_wrap.length ) {" . "\r\n" .
"tdUtil.scrollToPosition(header_wrap.height() + header_wrap.offset().top, 1200);" . "\r\n" .
"}" . "\r\n" .
"});" . "\r\n" .
'})();' . "\r\n" .
'});'
);
}
?>
<article id="post-<?php echo $td_mod_single->post->ID;?>" class="<?php echo join(' ', get_post_class('td-post-template-7'));?> td-container-wrap" <?php echo $td_mod_single->get_item_scope();?>>
<div class="td-full-screen-header-image-wrap">
<div class="td-container td-post-header">
<div class="td-crumb-container"><?php echo td_page_generator::get_single_breadcrumbs($td_mod_single->title); ?></div>
<div class="td-post-header-holder">
<div class="td-parallax-header">
<header class="td-post-title">
<?php echo $td_mod_single->get_category(); ?>
<?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 the_modified_date('j. F Y', '<div class="the-modified-date" itemprop="dateModified">Update: ','</div>'); ?>
<?php echo $td_mod_single->get_views();?>
<?php echo $td_mod_single->get_comments();?>
</div>
</header>
<div class="td-read-down"><i class="td-icon-read-down"></i></div>
</div>
</div>
</div>
<div id="td-full-screen-header-image" class="td-image-gradient-style7">
">
</div>
</div>
<div class="td-container">
<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-7.php', true);
comments_template('', true);
?>
<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>
----------------------------------- this part does not get displayed :I ----------------------
<?php echo $td_mod_single->get_social_sharing_bottom();?>
<?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();?>
----------------------------------- this part does not get displayed :I ----------------------
</footer>
</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-7.php', true);
comments_template('', true);
?>
</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-7.php', true);
comments_template('', true);
?>
</div>
</div>
<?php
break;
}
?>
</div> <!-- /.td-pb-row -->
</div> <!-- /.td-container -->
</article> <!-- /.post -->
<?php
get_footer();
Yes you can go to pages, click on the page you have set for homepage, go down to Homepage latest articles select posts loop settings ( https://www.screencast.com/t/WI9mftKM2J ) go down to Filters for the loop ( https://www.screencast.com/t/FZM2KNfkilm ), make sure that the offset posts is empty, or set it 0/1 to test it.
Hello mikeC_Oakland,
The default Sidebar structure can be changed from Widgets section area.
Notice that the Posts Loop can be changed from here -> https://www.screencast.com/t/CFsi48q6nkG
Hope this helps!
Thanks.
Hi,
You could go by code like in this topic maybe – https://forum.tagdiv.com/topic/add-a-custom-row-like-via-or-source-name-in-posts/
PHP codes like the one you mention have to be entered in the post template files, in order to be displayed in the posts that use those templates
– https://www.screencast.com/t/5qQCPBIUJE
Each post template has a corresponding loop file, try to add that code in a post template.
This is a related topic where some examples are mentioned
– https://forum.tagdiv.com/topic/custom-fields-howto-any-help/
Thanks
Hello,
I know your theme has not tested Facebook Comments Plugin and i already did the Facebook Comments Topic. It was working before the update but it’s not working now.
Before i added the header code in header.php and added <div class=âfb-commentsâ data-href=â<?php echo get_permalink($td_mod_single->post->ID); ?>â data-width=â100%â data-numposts=â10âł> to every loop-singles and it was working. Now it is not working. I did everything like before but it’s not showing.
Also i need to implement this code to my Cloud Template but RAW HTML or Text Column element is not showing Facebook Comment Box.
Please, you need to test Facebook Comments Plugin for your theme. There is lot of people who uses this plugin and really don’t want to change this codes every time.
Just comment, if you mean ‘infinite scroll’ – I thought that only worked for pages which use the default loop for showing more posts at bottom of a ‘page’ …
e.g.,
https://jetpack.com/support/infinite-scroll/
not on posts themselves.
For ‘pages’ such as an index, you can try this solution:
https://www.hongkiat.com/blog/wordpress-infinite-scroll/
(I don’t work here.)
Hello i created a new Cloud Template. http://maad.mn/2018/09/06/yeezy-boost-700-vx/ (this one). I tried to put my Facebook Comments code <div class=”fb-comments” data-href=”<?php echo get_permalink($td_mod_single->post->ID); ?>” data-width=”100%” data-numposts=”10″></div>
Previously i added this code to all Loop-single.phps and it worked.
Now i tried to add this code on my cloud template it’s not showing or bugged. I tried to use RAW HTML element and Column with Text element.
Where can i put this code to my cloud template?
The website does not load at the moment – http://prntscr.com/kq2qty
So from what I understand you used a flex block at the top and a post loop below. It all depends on your filtering and sorting used.
If the filtering used is set to display posts from that category and ordered by latest, they will be the same as in the loop. In that case set in the loop an offset according to the number of posts (modules) the flex block has.
For example if the flex block shows 3 posts, set an offset of 3 in the loop. That will avoid repeating posts.
I downloaded the blank category template in the cloud library and created one my way. But the modules repeat the posts … I used flex block 1 and loop posts to create the template of the category, but the posts insist on appearing duplicates … as a palliative I used offset posts, but it does not always turn out well.
Exemple:
Hi,
You mean the posts are duplicated within the category pages? I could take a look, provide a link to a category page where this happens.
There could be duplicated posts meaning posts displayed in the category grid and also in the post loop below. Try to use an offset in the post loop if that is the case, the value should be the number of posts displayed in the grid above. Like this example
– https://www.screencast.com/t/r6YSG3d0
If I misunderstand please correct me.
Thanks
I have set up my site based on the downloadable “Default” template and have modified the home page to fit with my site and all is 99% good.
The bit that I can’t work out is how to get rid of the bottom section of the home page which is made up of the “post loop” of all the posts on the site plus a sidebar. I can lose the sidebar easily enough but I can’t switch off the post loop.
I have all my posts accessible on category pages accessed from the menu …. I don’t want them all on the home page aswell. How do I lose that section ?
Hello,
I’ve add a custom category at the begin of content of posts.
And to do this I’ve added a function in loop-single.php.
Row 52
<!–<?php echo $td_mod_single->get_content();?>–>
<!– MODIFICA LOCALITĂ–>
<?php
$citta = “<div style=’float:left; padding-right: 5px; text-transform:uppercase;’ id=citta;>” . get_the_term_list( $post->ID, ‘localita’, ”, ‘, ‘, ‘.’ ) . “</div>”;
$contenuto = “<div id=contenuto;>” . $td_mod_single->get_content() . “</div>”;
echo $citta . $contenuto;
?>
Now, I would like add the custom category in excerpts in homepage. What can I do?
My site is http://www.infermierinews.it
Thank you so much.
Best regards,
Sara
Hi Ryansmccain,
Notice that section does not affect the structure of your posts. So, if you will set up your page to be by your latest posts -> https://www.screencast.com/t/1Cckwjn1Ns and if you will make some changes on this section you will affect the modules from your homepage set up by your latest posts. All the changes over your post should be made from loop-single or single template files as I have pointed your above.
Thanks for your understanding!
Greetings,
How I can get next post in loop in “next-previous” block?

The problem is, the latest post doesn’t have “next post” and I get blank space there đ
Thanks in advance
Hi,
I could take a look, provide a link to where this happens. Posts in the top category grid in category pages should not show in the loop below it.
Hi,
You can limit the loop number of posts in it’s settings, but you can’t filter it by another parameter (in this case featured). The loop will show posts that belong to the currently viewed category, that is all when it comes to filtering.
If you require this for a category or a couple of them, maybe use a block instead of the loop. You can filter that as you want and apply it to that category. This would be impractical for more categories however. You would have to create many templates, one for each.
Thanks
That is a flex block, what exactly are you doing with it? Placing that block in a tag template will not cause it to display only posts with a specific tag. It will display posts according to the filtering you set for it.
So configure the block to display posts with a certain tag, if you want to use a flex block in a tag template.
Usually the post loop element is used in tag pages for example, this will automatically display posts according to where it is placed
– https://www.screencast.com/t/yP6E0HQUMxp
A block will only display according to it’s filtering, regardless of where you place it.
Simion, by any chance, do you know the code that I can put in the tdb_loop.php file to have ads added every 3, 6 and 9 posts?
Thanks in advance.
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
Thanks this worked.
However with the latest update to the theme, i.e in Newspaper version 9, this trick does not work with posts loop block. Can you please help me with the corresponding php file to remove the reference of video-small.png, ico-video-large.png?
Hi There,
I was wondering if there is any option to add content in the homepage after the latest articles pagination? Basically it has to be before the sidebar and after the pagination. I was able to add the custom content by editing the loop.php, but it displays in between of list of posts and navigation buttons. Any help would be appreciated.
Hey! I added shortcodes in header.php and loop-single pages and when i comment on bottom of articles itâs not showing on facebook posts, itâs showing as YOU COMMENTED ON FACEBOOK PAGE. How do i connect facebook postsâ comments to my website articles.
Hello.
I have spent the past days trying to find a way to be able to filter my posts based upon category and custom taxonomy.
Since tagdiv sadly doesn’t support custom taxonomy filtering, I was hoping that adjusting a block might do the trick.
is it possible to perhaps make 26 copies of block 10 and module 10 (doable with the api plugin example on your site https://forum.tagdiv.com/practical-example-how-to-add-a-new-block-and-module/)
for instance block 10 A, block 10 B,.. to make an alphabetical index ?
I’d then adjust the post loop to only include posts from that taxonomy, whereas the filter in the tagdiv composer could then be set to the different categories (movies, music etc).
could you tell me if this is doable and where this query can be adjusted ?
I’ve followed literally all links you post in the replies stating have a look here, but they are always outdated or incomplete as an answer.
this is the loop argument that I’d like to include in the blocks:
$args = array(
'post_type' => 'post',
'posts_per_page' => '-1',
'meta_key' => 'keyword',
'orderby' => 'meta_value',
'order' => 'ASC',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'alphabetical_letter',
'field' => 'term_id',
'terms' => array( '441' ), //this is by slug
),
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => array( 'muziek-recensies' ), //this is by id
),
),
);
// The Query
query_posts( $args );
// The Loop
if (have_posts()) {
while ( have_posts() ) : the_post();
echo $td_template_layout->layout_open_element();
if (class_exists($td_module_class)) {
$td_mod = new $td_module_class($post);
echo $td_mod->render();
} 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();