No search results were found in Documentation!
I see, thank you. loop.php is easy – we can just add
if ( in_category( 'skipped category name 1' ) || in_category( 'skipped category name 2' ) ) :
continue;
endif;
after this line
while ( have_posts() ) : the_post();
I wonder how to fix front-page.php. We need to use something like
[td_block_big_grid_mob_1 sort="featured" category_ids="-33,44"]
instead of currently used
[td_block_big_grid_mob_1 sort="featured"]
but it seems category_ids isn’t supported attribute… Is there any hint to workaround?
thx
jiri
I want to show featured images on pages, like on posts. I managed this by using the following code in the page.php file:
<div class="td-page-content">
<?php
if ( has_post_thumbnail() ) {
$thumb_id = get_post_thumbnail_id();
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail-size', true);
$thumb_url = $thumb_url_array[0];
$thumb_id = get_post_thumbnail_id();
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail-size', true);
$thumb_url = $thumb_url_array[0];
?>
<div class="td-post-featured-image">
<a>">
<img width="696px" height="auto" />" alt="<?php the_title() ?>" title="<?php the_title() ?>" />
</a>
</div>
<?php }
the_content();
endwhile;//end loop
}
?>
</div>
The image shows allright, but the modal function doesn’t work. What do I need to change or add to use the modal function?
And if you have any improvements on the code above, please let me know. I am not a coder, although I can copy, paste and tweak a bit as you can see. But it probably isn’t optimal.
Hello,
The latest articles section is a loop for the latest posts or from a specific category you set. There cannot be any block added to this section. You can change the settings for it and set the number of posts to display here:
http://screencast.com/t/a2vjREw0p
Thank you!
Hi,
Please follow this method https://forum.tagdiv.com/topic/how-to-insert-ads-between-posts-on-the-main-categories-and-in-the-archives/ and adapt it to the pagebuilder loop. You will require coding skills for this though as the theme does not provide any setting for ads inside the latest article section.
Thank you!
Hello, our site posts have “Related Articles” and “More From Author” box enabled. I like this feature!
Unfortunately, both of these elements are displaying the same set of articles, under the “Related Articles” and “More From Author” tabs … even articles that are from different author.
Example here. You will see what I mean, by looking at bottom of that article, and toggle back and forth both tabs … same posts! 🙁
So apparently the array of posts being used to populate these boxes is somehow not filtering properly. Or the loop is messed up … or something! 🙂
Any ideas on where to look? Where do those elements get their array of posts? Maybe that offers a clue?
Thanks!
I have 2 posts that I would like to keep on the main page of my site – dream360.tv and I have edited the dates and also changed the settings for the actual page – post loop settings along with sorting it by featured aricles.
Is there an easier way for me to keep the 2 posts on the front page?
Hello zdenko.chabada,
If you want to add some options in your posts template you will have to alter the code corresponding to what type of post template you are using. So, for example, if you are using the post template styl1, you will have to change/add the code in the single_template_1.php or loop-single-1.php, like this -> http://screencast.com/t/xYuPBexl20u
Thanks for your understanding!
Quick follow up:
I’ve managed to edit the code above to show the category I want and customized it appropriately. However, when I duplicate the code to make a second “block,” I only get a header with no posts. Is it written in such a way that it can’t be duplicated? Here is my modified code:
<div class="td-container td-pb-article-list td-main-content" role="main">
<?php if ( empty( $paged ) or $paged < 2 ) { ?>
<h4 class="block-title"><span>IndyCar</span></h4>
<?php }
// query used on Latest Articles section
$wp_query_args = array(
'ignore_sticky_posts' => 1,
'post_status' => 'publish',
'posts_per_page' => 5,
'paged' => $paged,
'category_name' => 'indycar'
);
query_posts($wp_query_args);
locate_template('loop.php', true);
wp_reset_query();
?>
</div>
<div class="td-container td-pb-article-list td-main-content" role="main">
<?php if ( empty( $paged ) or $paged < 2 ) { ?>
<h4 class="block-title"><span>Sports Car</span></h4>
<?php }
// query used on Latest Articles section
$wp_query_args = array(
'ignore_sticky_posts' => 1,
'post_status' => 'publish',
'posts_per_page' => 5,
'paged' => $paged,
'category_name' => 'sportscar'
);
query_posts($wp_query_args);
locate_template('loop.php', true);
wp_reset_query();
?>
</div>
Thank you.
Thank you so much for the response. I’d like to change the sorting of the grid to recent, so this helps. I’d also like to replace the recent list of articles under that with blocks for specific sections like those that are found on the main theme. Is there a way to edit the code to accomplish this as well?
Example:
<div class="td-container td-pb-article-list td-main-content" role="main">
<?php if ( empty( $paged ) or $paged < 2 ) { ?>
<h4 class="block-title"><span><?php echo $td_list_custom_title; ?></span></h4>
<?php }
$posts_per_page = get_query_var('posts_per_page') ? get_query_var('posts_per_page') : 10;
// query used on Latest Articles section
$wp_query_args = array(
'ignore_sticky_posts' => 1,
'post_status' => 'publish',
'posts_per_page' => $posts_per_page,
'paged' => $paged,
);
query_posts($wp_query_args);
locate_template('loop.php', true);
echo td_page_generator_mob::get_pagination();
wp_reset_query();
?>
</div>
Example: could I take the above code and limit the query to a single category? And, repeat the code several more times to create additional blocks?
Thanks again.
Hi,
The category.php file is in the root directory of the theme: http://screencast.com/t/H9xO8obkt The top posts and category templates are found in newspaper/includes/: http://screencast.com/t/Du0wo8G2th6
The loop itself is created in loop.php also in the main directory.
Hope this helps.
Thanks.
Hi,
IF you follow this link: https://forum.tagdiv.com/the-mobile-theme/ you will see that the big grid on the mobile theme does not show random posts but rather featured posts. The latest posts are underneath it. If this grid would be set to latest as the loop below it, then the first 3 posts will be repeated in both elements.
Thank you!
Can you write out exactly what we are supposed to do here? I added this to my child functions.php but it still only shows 4 products:
// Woocommerce Number of product per page 8
add_filter(‘loop_shop_per_page’, create_function(‘$cols’, ‘return 20;’));
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
}
}
Hello uchubald,
Please notice that if you want that you Big Grid to be sorted by latest, you will have to replace the 'featured' with the 'latest' but please notice that after this your the top three posts from your Latest Articles will be the same with your posts which are displayed to your Big Grid in the top of the page. Please notice that because of this fact we choose to set this type of sorting for our Big Grid to avoid this duplication, as you can see here -> http://screencast.com/t/jmMzhjhN7BJ Please notice that we cannot set the offset for latest articles to avoid this case because this type of feature are working by a loop and will show you all these posts ->you cannot sort them.
Thank you for your understanding!
Hi, thanks I have updated the visual composer and pictures are back The only thing is that the “post loop settings” are only showing one column of the lastest posts. Previously it was showing as a two column. I am using M7 layout. Here’s my site. http://darkstarastrology.com/
Also my comments have gone weird but I’m guessing it that something to do with disabling plugins.
-
This reply was modified 10 years by
darkstarmarina.
-
This reply was modified 10 years by
darkstarmarina.
Hello arvindk,
Please notice that the Ads will be displayed for your smart list only if you will use the Smart list 6,7,8 -> http://screencast.com/t/CTFhbjN8Z and the ads for these you can set from the Theme panel, like this -> http://screencast.com/t/cg1K7wGv7pA
Unfortunately, we do not have a list with theme shortcode. So, if you want to use the do_shortcode() method, all of your desired shortcode you will have to take from your Visual Composer, like this -> http://screencast.com/t/Xqf5mOWElRH and the shortcode for this element you can get it in this way, like this -> http://screencast.com/t/YmiFx4k6Pyr This type of method are used then you want to add your ads (in this example) in a certain place of your site. For example, the snippet of the code for this Ad box will be the following ->>
<?php echo do_shortcode('[td_block_ad_box]');?> and then this it would have to be added in the core files corresponding to your desired place from your website. (for example, if you add the ad in your posts, you have to edit the loop-single corresponding to single template used by you and so on).
If you need more assistance in this regard or you have another problem, please submit a new topic on the forum.
Thank you for your understanding!
Hi there,
First of all, please accept my apologies all of these.
Please allow me to ask a few things about customization of the new Newspaper version 7.0.
1. Since I am doing some customization on my site and based on what I had read on the documentation and on your rules that any update of the Theme we should try again to re-implement the code for our customization, so I decided instead of doing that again and again is to add the Child Theme, that any update of the Theme still the customization of site will be there right? Please advise if this the best option? Hope it will.
2. (If Serial 1 is not the best option, leave this.) Please advise if this is correct to Add a Child Theme via FTP I will just add the Folder “Newspaper-child” located in /code folder? base on this Tutorial Link to add it under “wp-content/themes” right? by just dragging it via FTP? same on this Image Link.
3. Author Box Card replace it with USERPRO shortcode.
Filename:
/wp-content/themes/Newspaper/loop-single-12.php – this is my style number
ShortCode to add:
<?php echo do_shortcode('[userpro template=card user=author]');?>
Original String Structure:
<?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();?>
</footer>
Modified String Structure: Please advise if this is correct syntax code?
<?php echo $td_mod_single->get_social_sharing_bottom();?>
<?php echo $td_mod_single->get_next_prev_posts();?>
<?php echo do_shortcode('[userpro template=card user=author]');?>
<?php echo $td_mod_single->get_item_scope_meta();?>
</footer>
3.a. If I am using a Child Theme I just copy the Filename then create a directory structure path in the child theme as in the theme and paste the Filename based on this Tutorial Link aight?
4. Sign In/Join Desktop view popup version using USERPRO shortcode
Filename: wp-content/themes/Newspaper/parts/header/top-menu.php
ShortCode to add:
<div class="td-login-wrap">
' . do_shortcode('[userpro template=login]') . '
Original String Structure:
//<span class="td-sp-ico-logout"></span>
echo '<ul class="top-header-menu td_ul_logout">
<li class="menu-item">' .
get_avatar($current_user->ID, 20) . 'ID) . '" class="td_user_logd_in">' . $current_user->display_name . '' .
'
<li class="menu-item">
<i class="td-icon-logout"></i>' . __td('Logout', TD_THEME_NAME) . '
';
} else {
echo '<ul class="top-header-menu td_ul_login"><li class="menu-item">' . __td('Sign in / Join', TD_THEME_NAME) . '<span class="td-sp-ico-login td_sp_login_ico_style"></span>';
}
}//end login window
Modified String Structure:
Please advise how to add the correct syntax code.
4.a. Same on Serial 3.a. question.
5. Sign In/Join Mobile View using USERPRO shortcode
Filename:
Please advise where to modify it?
ShortCode to add:
Please advise the correct syntax code for this.
' . do_shortcode('[userpro template=login]') . '
Original String Structure:
Please advise where to modify it?
Modified String Structure:
Please advise how to add the correct syntax code.
5.a. Same on Serial 3.a. question.
6. FB Comments instead of WP comments
Filename:
wp-content/themes/Newspaper/header.php
wp-content/themes/Newspaper/loop-single-12.php
ShortCode to add:
header.php
<div id=”fb-root”></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = “//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=XXXXXX”;
fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));</script>
loop-single-12.php
<div class="fb-comments" data-href="<?php echo get_permalink($td_mod_single->post->ID); ?>" data-width="100%" data-numposts="5"></div>
Original String Structure:
header.php
</head>
<body <?php body_class() ?> itemscope="itemscope" itemtype="<?php echo td_global::$http_or_https?>://schema.org/WebPage">
<?php /* scroll to top */?>
<div class="td-scroll-up"><i class="td-icon-menu-up"></i></div>
<?php locate_template('parts/menu-mobile.php', true);?>
<?php locate_template('parts/search.php', true);?>
loop-single-12.php
<?php echo $td_mod_single->get_item_scope_meta();?>
</footer>
<?php echo $td_mod_single->related_posts();?>
<?php
} else {
//no posts
echo td_page_generator::no_posts();
}
Modified String Structure: Please advise if this is the correct syntax code?
header.php
</head>
<body <?php body_class() ?> itemscope="itemscope" itemtype="<?php echo td_global::$http_or_https?>://schema.org/WebPage">
<div id=”fb-root”></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = “//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=XXXXXX”;
fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));</script>
<?php /* scroll to top */?>
<div class="td-scroll-up"><i class="td-icon-menu-up"></i></div>
<?php locate_template('parts/menu-mobile.php', true);?>
<?php locate_template('parts/search.php', true);?>
loop-single-12.php
<?php echo $td_mod_single->get_item_scope_meta();?>
</footer>
<div class="fb-comments" data-href="<?php echo get_permalink($td_mod_single->post->ID); ?>" data-width="100%" data-numposts="5"></div>
<?php echo $td_mod_single->related_posts();?>
<?php
} else {
//no posts
echo td_page_generator::no_posts();
}
6.a. Same on Serial 3.a. question.
7. If there is a new update of the Theme like for example: header.php as we added a Custom Code on version 6.x.x has 92 Lines + 2 Lines on our Custom Code both on Main Theme and Child Theme then a new update came version 7.0 header.php has 98 Lines, since our Child Theme had originally 92 Lines, are we going to update also our Child Theme structure based on the latest one from 92 Lines to 98 Lines then + 2 Lines on our Custom code?
8. Mobile Theme Plugin – if I install this plugin would the Child Theme modification will reflect to this? I mean I made changes in Serial 3, 5 and 6 will it reflect also? Please advise.
8.a. Whats the difference between Theme Panel background color for mobile vs Mobile Theme Plugin Settings background color? Which one should I make the changes if this Plugin is installed?
8.b. Gradient color – may I ask the exact hex number of this color? Link Here
9. Am I allowed to create directory structure and add the following filename on the Child Theme incase all of the above are possible to my site.
>loop-single-12.php
>top-menu.php
>For Serial 5 filename
>header.php
I have sent my Login Credentials via mail incase you may need it with the same Subject here.
Regards
Hello.
How i can add facebook comments on Newsmag theme without plugins?
I tried to install it with your instruction and added this code: <div class=”fb-comments” data-href=”<?php echo get_permalink($td_mod_single->post->ID); ?>” data-width=”100%” data-numposts=”5″></div> in all loops files.
it works only when instead of this part: <?php echo get_permalink($td_mod_single->post->ID); ?> i write my website url, but in this case it shows the same comments on all posts.
Maybe i also have to add this code in single_template files? if yes please send me screenshot where exactly i need to add this code in single_template file
Thanks
Version of Visual Composer included with the theme is 4.11.2 which is latest version tested compatible with Newspaper. It’s included in your theme downloads from ThemeForest.
07.04.2016 – ver 4.11.2
– Added: Compatibility with WP 4.5
– Added: Filter for database query limits
– Improved: Input Sanitization
– Improved: TGMPA compatibility
– Improved: Pageable Container Back button behavior
– Improved: vc_siteAttachedImages now uses get_posts instead of direct query
– Improved: Ordering by meta key in grid elements
– Improved: loop param work with multiple taxonomies selection
– Fixed: Google maps scroll behavior
– Fixed: Initial loading for Masonry Media Grid
– Fixed: Advanced Custom Fields vendor initialization
– Fixed: Post Grid filter taxonomy names collapsing
Hi Catalin,
I manage now to update my site to 7.0 without having a problem and I am proud to share it to the community.
Please help me to implement back the following:
1. Please advise if this is correct for Facebook comments and USERPRO Author Box – I manage to set this properly on the previous version 6.7.2 I am using loop-single-12.php style
<?php echo $td_mod_single->get_social_sharing_bottom();?>
<?php echo $td_mod_single->get_next_prev_posts();?>
- - - This is what I inserted a shortcode to show a USERPRO Author Box Card - - -
<?php echo do_shortcode('[userpro template=card user=author]');?>
<?php echo $td_mod_single->get_item_scope_meta();?>
</footer>
- - - This is what I inserted a code to show Facebook Comment - - -
<div class="fb-comments" data-href="<?php echo get_permalink($td_mod_single->post->ID); ?>" data-width="100%" data-numposts="5"></div>
<?php echo $td_mod_single->related_posts();?>
For Facebook comment – I place a code in header.php
<body <?php body_class() ?> itemscope="itemscope" itemtype="<?php echo td_global::$http_or_https?>://schema.org/WebPage">
<div id=”fb-root”></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = “//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=XXXXXX”;
fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));</script>
<?php /* scroll to top */?>
2. http://prnt.sc/b2jo8d – I want to know the exact gradient color of that in the screenshot.
Regards
Hello andaluciavive,
If you want to move the “Related Articles” from the original position to be after the post content, you have to move the code from single-template_11.php and paste the code to the loop-single-11.php core file, after the content, like this -> http://screencast.com/t/JroQrDBBzna -> http://screencast.com/t/CaYu2LtIgS and then you have to use a bit of CSS code to change the color for better results.
The result you should see here -> http://screencast.com/t/YzQhusom
The custom CSS code is ->
.td-post-template-11 .td_mod_related_posts a {
color: red;
}
And the PHP code which you have to move in loop file is ->
<?php echo $td_mod_single->related_posts('no_sidebar');?>
Hope this helps!
Thank you for your understanding!
Salut,
Nu am primit inca nici un feedback referitor la setarile din theme panel pe newspaper 7. Cea mai intalnita problema legata de setari este pluginul wordfence care intr-adevar facea ca setarile din theme panel sa nu se salveze. Daca ai wordfence, incearca solutia postata de Bryson aici: https://forum.tagdiv.com/topic/cant-save-theme-settings/
Referitor la tema mobila, grid-ul a fost facut sa aduca posturile featured pentru ca ‘latest posts’ aduce modulul de latest articles. Problema in a seta latest si pe gridul de sus (ceea ce nu este greu deloc) este ca primele 3 posturi vor vi dublate intrucat un offset pe loop nu exista si nu este usor de adaugat. Modulul de jos (latest) nu este un block ci un loop.
Multumesc.
Hi Bogdan,
A million thanks to you.
1. You are a amazing, I manage to put Facebook Comments now without having a Facebook plugin.
Guys I wanna share this to you anybody out there who tried to put FB comment instead of the default one.
Source: Link Here
Here’s what I did:
1. In order to implement facebook comments, you have to disable the theme comments and then place the facebook comments shortcode in the template files.
You have to do this for every post style you use on your site. every post style has it’s own file.
Theme Panel > Post Settings > ENABLE COMMENTS ON POSTS
Enable or disable the posts’ comments, for the entire site. > Disable – Credits to Bogdan B.
2. Add the following code to header.php located /wp-content/themes/Newspaper
after this line: <body <?php body_class() ?> itemscope=”itemscope” itemtype=”<?php echo td_global::$http_or_https?>://schema.org/WebPage”>
add this code:
<div id=”fb-root”></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = “//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=XXXXXX”;
fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));</script>
end to before this line: <?php //this is closing in the footer.php file ?> – Credits to Chris S.
3. Add the following code to loop-single.php style and this depends what style number you are using, know or add it to all
styles. My style is loop-single-12.php
add this code:
<div class=”fb-comments” data-href=”<?php echo get_permalink($td_mod_single->post->ID); ?>” data-width=”100%” data-numposts=”5″></div>
end to before this line: <?php echo $td_mod_single->related_posts();?> – Credits to Andrei L.
4. If you are facing this issue “Only one issue–the comment count is appearing twice on our site (www.alaskapublic.org), once in the body of the post and once below. I’d like to delete the upper one. Our comment count is disabled in the theme panel.
Screenshot: http://www.alaskapublic.org/wp-content/uploads/2016/04/Screen-Shot-2016-04-12-at-4.12.41-PM.png” – @sarahglaser
Soln:
Try this css in theme panel > custom code > custom css to hide the first comment counter: http://screencast.com/t/ZyTOiRdT
.fb_comments_count{
display: none;
}
– Credits to Andrei L.
Note to tagdiv staff/admin: Please feel free to remove this comment if not allowed here.
Regards
Hi,
If the ad code works on a page in the ad box then it will work on posts in the loop-single files like so:
http://screencast.com/t/bEBbqh9fmj the code was added above the related articles and here it is: http://screencast.com/t/mS6OhaIb
Thanks.
hello,
i paste ad codes in custom ad 1 and in single-loop.php i paste <?php echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_1"]‘)?> but still its now showing me any ads so i put ads on td-module-relarted-posts.php
but i want to add these codes in single-loop.php..
Hello Is there a way to enable just the loop on the bottom of the home page ? I tried using shortcode “<!–nextpage–>” through text block or raw html and doesn’t seem to work. \
https://forum.tagdiv.com/page-templates-2/
https://forum.tagdiv.com/posts-with-pagination/
I’ve located documentation on how to enable post pagination at the bottom of the home page or on a post but cannot get it to display on my home page without the Post Grid(Recent articles title, thumbnail, excerpt etc)
Your help and insight is greatly appreciated