- NewspaperPosts Loop Element
- NewspaperFlex Block Builder and Flex Loop Builder
- Apitd_api_category_top_posts_style::update_key
- Apitd_api_category_top_posts_style::update
- Apitd_api_category_top_posts_style::add
- NewspaperBookmark – Save For Later
- NewspaperModules Builder in Newspaper Theme
- NewspaperFilters and sorting for taxonomies
- NewsmagPage templates
- NewspaperPage templates
- NewspaperSmart Sidebar
- NewspaperChild Theme Support
- ApiAPI – Thumbnail – Introduction
- ApiAPI – Category top section style – Introduction
Hello themesic,
If you need to add some things below posts loop in a post, please notice that you will have to use the same method which I have presented you above, named do_shortcode and you will have to place it in the corresponding loop single template with your post template used by you. For example, if you are using the Post Template Style 1, you will need to add that snippet of the code in loop-single-1.php core file in order to achieve good results, like this -> http://screencast.com/t/EIo5hfLusV5 and the result you should see here -> http://screencast.com/t/Fpibc4JGqD
I hope that helps! If is not what you mean, please be more specific, provide more details and also you can send us some useful screenshots so I can understand it better what you mean.
Thanks for your understanding!
So its not possible to have a posts loop added by the visual composer manually. Why are we forced to use posts loop after the visual composer user-added components ? All I want is to be able to place things below posts loop – this is not a custom development need, its a basic one –
Hi Catalin.
Thanks for your answer but im again confused.
I want to use it on pages, not posts.
I want to have a row added to visual composer and make sure that it is being displayed after posts’ loop of the front page, at the bottom.
But no matter of what I add to the bottom of visual composer, posts loop is being displayed always after its content, on the frontpage.
Let me tell you a scenario:
Install a fresh copy of WP and install the theme along with its dummy content. Frontpage has now some imported content. Lets go to the frontpage and add a new row with some text, at the very end, after all other elements.
You save and refresh and your new row is there, but it appears before posts’ loop.
Hm.
Well couple of wrinkles.
1) changing the mx2 to mx9 still tries to load a large thumbnail 511×400
//build the results / try mx9 vs mx2 8.22.16
if (!empty($td_query->posts)) {
foreach ($td_query->posts as $post) {
$td_module_mx9 = new td_module_mx9($post);
$buffy .= $td_module_mx9->render();
}
}
2) removing the thumbnail from the mx2 module leaves the blank space; so I tried removing the outer div, and then applying a style class override at bottom of style.css to make all text font size 15px; but had no impact.
Still playing with this. Seems like I need to double check the mx2 module not being used in anything else first. Might need to make new module like x2search then revise the CSS for that to remove the thumbnail indent padding before the text loop.
———— EDIT ———–
oh, duh — perhaps I should try module 9 vs mx9 ? LOL.
THis worked (and double duh)
//build the results / try _9 vs mx2 8.22.16
if (!empty($td_query->posts)) {
foreach ($td_query->posts as $post) {
$td_module_9 = new td_module_9($post);
$buffy .= $td_module_9->render();
}
}
Thanks for the response.
I think that you didnt get my second point (2).
I want to have some content added to visual composer and make sure that it is being displayed after posts’ loop.
But no matter of what I add to the bottom of visual composer, posts loop is being displayed always after its content.
I’m thinking of two alternatives:
– Is there any way to have posts loop included inside Visual composer?
– Is there any way to have last row shown in the exact last row position in the frontend ( after posts loop ) ?
Hi.
We use M4 for our latest posts loop and we would like to ask you the following:
1) Can we show 3 (smaller of course) posts in the left side + sidebar in M4 ? We found no option regarding this
2) We want to add some content that will appear on the bottom of the webpage when using “pagebuilder + latest articles + pagination” template. W
ith which way we should content in the bottom?
I think that the best way to do so is to switch to “pagebuilder + title” template and have the latest articles added manually.
We tried to do so, but this doesnt add the sidebar.
Please advise.
Hi,
This will have to be made custom by a developer as there is no way from the them settings or from the them code to make this happen. You will have to create custom functions to call the acf on the category pages.
Try this topic from the wp forums https://wordpress.org/support/topic/list-posts-by-key?replies=22#post-385388 and try to replicate the code in the category files if you have the proper coding skills. Posts are handled by the loop.php file.
Thank you!
Hello,
The number of posts populated in loops such as the category template or the search results is handled by WordPress. This is the setting that dictates this behavior: http://screencast.com/t/c5Q3WTw6
Thank you!
Hello!
By default loop ads are working on mobile and it is working fine….after 5th posts we want to show the ads again after 9th Post…keeping the maximum 3 ads policy in our mind.
How we can do that…??
How to show adsense ads on home page, category and tag page like we have loop ads in mobile theme??
We want to show the ads after every 4 or 5 posts please advice how to do that in desktop & tablets..??
Hi, this is my functions.php which seems quite different to yours? i am unsure where to add this?
<?php
/*
Our portfolio: http://themeforest.net/user/tagDiv/portfolio
Thanks for using our theme!
tagDiv - 2016
*/
/**
* 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">BUY NEWSPAPER NOW!</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 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">" class="td-set-theme-style-link td-popup td-popup-<?php echo $td_demo_names[$stack_params['text']] ?>" data-img-url="http://demo.tagdiv.com/demos_popup/newspaper/large/<?php echo $demo_id; ?>.jpg"></div>
<?php } ?>
<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"></div>
<div class="td-screen-demo" data-width-preview="380"></div>
<div class="td-screen-demo-extend"></div>
</div>
<?php
}
}
Hello avicabessa,
I suppose that you want to add your ads after every post when you are using the Blog mode (front page displays your latest posts), right? So, if you want to do that, you will have to use the do_shortcode method, create the shortcode using the Visual Composer and then add it in the loop.php file. First of all, you will have to add your custom ad code in your Custom Ad 1 area from Theme panel, like this -> http://screencast.com/t/8960iRYbP and then, using this snippet of the code > echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
This will have to be added like this -> http://screencast.com/t/b43jvDsyt and the result you should see here -> http://screencast.com/t/nZHwT04z3
Hope this helps!
Thanks for your understanding!
Hello zconsulting,
Another simple way would be to remove the related posts calling from your loop-single-1.php and add it underneath the comments in your single_template_1.php, like this -> http://screencast.com/t/OwStNGytCV and http://screencast.com/t/1hsmr6uVf3 and the result you should see here -> http://screencast.com/t/peAGoGo8vH Please notice that this is just an example for post template style 1.
Thanks for your understanding!
Hello,
1) I’d like to know how to change the number of posts that are displayed (loaded when you open the page) on the page: http://www.example.com/category/name-of-the-category/
2) How can I order posts in the category page in a different way? Like by date but ASC and not DESC or by another field (id, title, …)
3) It’s possible to customize the mega-menu to show more sub-categories? I need to show all the months of the year but it shows only 6 months. It’s possible to modify the loop to load 12 items instead of 6?
Thanks 🙂
Hello,
For people,the freshness of content always matters. So, I’m experimenting to replace the meta info from loop-single.php and successfully changed it to “Last updated on: X/Y/Z” on every single posts. However, I see that for each and every module I have to edit the meta info code in order to replace the publish date with the last modified time.
So, basically, I know how to do that. But, was wondering if you could let me know a single file which I can modify once to replace dates everywhere on the site from the published date to the last modified date.
P.S: Using the Instant WordPress. Not trying it on a live site. So, feel free to share what you feel may work out for me to replace the dates site-wide from date of publish to the last modified date.
Hello Sylvester77,
If you want to affect every post with your code, please notice that you will have to add it in each post template used by you, like this -> http://screencast.com/t/IwNk4F1E65m So, for example, if you are using the post template 7 to display your posts, you will have to add it in loop-single-7.php or single_template_7.php. Please notice that all of these changes involves additional customizations through the code and this type of services are not covered by ou support. If you are not aware of the steps in this regard, please consider hiring a freelancer/developer to help you because we cannot provide customization services at the moment, sorry!
Thanks for your understanding!
Hi,
I did what you said but It din´t work yet…
The header.php file was like that:
<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/pt_BR/sdk.js#xfbml=1&version=v2.6&appId=1006446862796383″;
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);?>
<div id=”td-outer-wrap”>
<?php //this is closing in the footer.php file ?>
It´s a but different than the example you showed, the exemple you showed was a newsmag, my one is a newspaper.
The loop-single.php was like that:
<?php echo $td_mod_single->get_content();?>
<div class=”fb-comments” data-href=”<?php echo https://portalmaesefilhos.com.br/ ($td_mod_single->post->ID); ?>” data-width=”600″ data-numposts=”5″></div>
</div>
So, I just paste the in the files you showed, but I went to my website and nothing changed!
I didn´t make any change in the single.php file, I saw you marked with a red box thos files, but I didn´t do anything in there.
Now I will put the orinal codes in header.php and loop-single.php and think what I can do to solve it.
Thanks again!
Hi
1. You can increase the articles number from Settings > Readings: http://screencast.com/t/PCgTF0s9KEDB
2. The posts from mobile homepage are generated in loop.php: http://screencast.com/t/kjSaNrIH You could use this implementation as exapmle: https://forum.tagdiv.com/topic/how-to-add-ads-in-category-pages/
Thanks!
Hello,
Please I need to show the time on all posts, how can I do this on your theme loop.php?.
Thanks in advance,
Raul.
Hi,
If you only need to insert one ad, not repeated after a number of posts, then you do not need to use the adcounter. You can simply use a do_shortcode function in the category template like so:
http://screencast.com/t/3AhOEXNl9lPl
<div class="mycustomclass">
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?>
</div>
It will need a few css adjustments to remove the bottom margin and add a top margin for it to position properly so you can use the custom class assigned to the div element.
As for the bottom ad you need to use the same procedure but this time place the code at the bottom of loop.php from the root directory.
I hope this helps.
Thank you!
Hi
To achieve the desired result you can place the code from Facebook inside a container and add a border on it.
Paste this code in loop-single-12.php:
<div class="fb">
<div class="fb-page" data-href="fb-page" data-tabs="timeline" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"><blockquote cite="fb-page" class="fb-xfbml-parse-ignore"><a href="fb-page/">My Facebook page</a></blockquote></div>
<div class="fb-comments" data-href="<?php echo get_permalink($td_mod_single->post->ID); ?>" data-width="100%" data-numposts="5"></div>
</div>
Use this css to add the border:
.fb{
border: 2px solid #f3f3f3;
}
Thanks!
Hello Tycoonz Fitness,
Unfortunately, please notice that our theme does not have such a simple option for this but only if you add them through code. Please keep in mind that if you want to edit the files which affect the posts, you will have to edit the single template and loop-single for each template. Also, all the functions from our theme have been located in functions.php, like this -> http://screencast.com/t/m9AxbprUEKB and here -> http://screencast.com/t/XhYjNGXPJ
Please notice that our support does not cover this type of request and if you want to do that, please notice that you need to have a solid knowledge of PHP/HTML/JS/CSS and if you are not aware of the steps in this regard, please consider hiring a freelancer/developer to help you because we cannot provide customization services at the moment, sorry
Thanks for oyur understanding!
Hi Andrei,
First of all, I am not using any Facebook plugin for WordPress, I took the idea from you and Chris only on how to implement these codes without using a WordPress plugin and thanks for all of these idea.
I wanted to achieve this: http://prntscr.com/bksntv where “Facebook Page Plugin” and “Facebook Comments” are inside the box in one place, source for “Facebook Page Plugin” base on this link here: Click Here and source for “Facebook Comments” base on this link here: Click Here
1. I place a code to my header.php base on you and Chris idea
<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.6&appId=(I place my APP id here)";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
2. I place code also for FB Page and FB comments on loop-single-12.php this is the Style I am using
<div class="td-post-content">
<?php echo $td_mod_single->get_content();?>
<div class="fb-page" data-href="https://www.facebook.com/(I place my Page URL here)/" data-tabs="Page" data-width="500" data-small-header="true" data-adapt-container-width="true" data-hide-cover="true" data-show-facepile="true"><blockquote cite="https://www.facebook.com/(I place my Page URL here)/"><a href="https://www.facebook.com/(I place my Page URL here)/">(I place my Page Name here)</a></blockquote></div>
<div class="fb-comments" data-href="<?php echo get_permalink($td_mod_single->post->ID); ?>" data-width="100%" data-numposts="5"></div>
</div>
3. I don’t have any issue on implementing that code above mentioned as it works perfectly. I wanted to achieve that both of them as you can see on the screenshot they are wrapped inside a box with a thin border and its responsive also to any device, I want to know if I declared it correctly and proper syntax code on how to wrapped both of them inside the box with a thin border line, what to declare and where can I place it.
Regards
-
This reply was modified 10 years by
ilnegozio.
Right now all the posts are using the default post template.
I added the above codes to loop-single.php so every post will show that.
My concern is that I have a few categories that don’t want to show the extra blocks, so my question is there anyway to exclude the blocks from those categories?
I found a temp. solution for that is I have to go into each post that I don’t want to show the block and choose a different post template from the post page itself.
If you have a better solution please help me out.
Thank you for your support.
Hi
First you have to edit header.php file and paste the js from facebook as I’ve indicated here: Then edit loop-single-5.php and loop-single-9.php and paste this code where you want to display fb-comments. Here are some examples: http://screencast.com/t/KMfJ8O0jL2 – http://screencast.com/t/kWdtLeWQU8K – http://screencast.com/t/O5H1oEES6
<div class="fb-comments" data-href="<?php echo get_permalink($td_mod_single->post->ID); ?>" data-width="100%" data-numposts="5"></div>
Hope this helps.
Thanks!