Need little help with most demanded 'Auto Load next post' thing.

Posted in: Newspaper
Post count: 436

Hi TagDiv Support Team,
I know that you have heard about this millions of times and have been requested by hundreds of TagDiv customers to look for any variable solution for this, but none of them has worked till now.

But, I believe that with little extra help, we can have a solution to this with a third party plugin called “Auto Load Next Post’ ( Here is the link: https://wordpress.org/plugins/auto-load-next-post/ )

The reason that many such third party plugin doesn’t work with Newspaper is that Newspaper themes uses highly customised versions of WordPress codes and hence many times, it doesn’t work well with plugins that have been written using core WordPress codes.

Thankfully ‘Auto Load Next Post’ plugin provides an option to edit a file called ‘content-partial.php’ which is actually used to fetch next post for the auto loading and it can be customized based on the theme on which we want to use it.

Here is the complete ‘content-partial.php’ file: https://pastebin.com/nbebh8YE

Under this file, we need to replace ‘standard wordpress file name’ with ‘the theme specific codes’. There are only 4 or 5 such replacement needed here. Here is the short version of code that need to be replaced:


// Check that there are posts to load.
while (have_posts()) : the_post();

$post_format = get_post_format(); // Post Format e.g. video

// Load content before the post content.
do_action('alnp_load_before_content');

// Load content before the post content for a specific post format.
do_action('alnp_load_before_content_type_'.$post_format);

if (false === $post_format) {
// Include the standard content.php file.
get_template_part($template_location . 'content');
} else {
// Include the post format content.
if (locate_template($template_location . 'format-'.$post_format.'.php') != '') {
get_template_part($template_location . 'format', $post_format);
} else {
// If no format-{post-format}.php file found then fallback to content-{post-format}.php
get_template_part($template_location . 'content', $post_format);
}
}

Kindly help me to convert this code in a way that is relevant to this theme. I am hopeful that in this way, it can work in desired way and if it happened, it will surely solve the queries of the hundred of Tagdiv customers.

If you want to dig deeper, let me know and I will provide the login access of my site to look inside.

Thank you.

Post count: 22421

Hello,

We understand this is a very requested feature and we do plan on adding it in our themes but as you mentioned above we have not found any viable solution yet. We have tried a few plugins ourselves but we could not manage to get them to work properly. Unfortunately if this is not decided by the development team, we will not be able to help as time does not allow us to tackle time consuming tasks. The theme support does not cover such customization. Sorry. You will have to hire a freelancer to help out if this feature is very important for your website.

Thank you!

Post count: 436

Hi Bogdan,
Thanks for your reply. I very much know about the time issue and I do understand the TagDiv Team limitations. Though my question written above might appear lengthy it was more to give an idea about the solution that can work.

The support that I currently require doesn’t need you to dive deep into these things. I only wanted to know about the file names of 4-5 codes that are specifically used by Tagdiv team in replacement of the standard WordPress codes.

Making it more simple, can you please provide the ‘Newspaper’ theme friendly version of this code:

// Check that there are posts to load.
while (have_posts()) : the_post();

$post_format = get_post_format(); // Post Format e.g. video

// Load content before the post content.
do_action('alnp_load_before_content');

// Load content before the post content for a specific post format.
do_action('alnp_load_before_content_type_'.$post_format);

if (false === $post_format) {
// Include the standard content.php file.
get_template_part($template_location . 'content');
} else {
// Include the post format content.
if (locate_template($template_location . 'format-'.$post_format.'.php') != '') {
get_template_part($template_location . 'format', $post_format);
} else {
// If no format-{post-format}.php file found then fallback to content-{post-format}.php
get_template_part($template_location . 'content', $post_format);
}
}

This code has few file name like the_post() $post_format get_template_part($template_location . ‘content’); , you just need to replace these codes with the filename/code that Newspaper theme support. Or if these codes are already supported by this theme, let me know that as well.

Thank you.

PS: if your team is really interested in creating something inbuilt for this in future. Here is great site that provides some inbuilt codes for it: https://infinite-scroll.com/
. these are the behind great old plugin https://wordpress.org/plugins/infinite-scroll/ and now they are working on V2 of this plugin.

Post count: 22421

Hi,
Sorry but there is no code I can provide that will work with the code you provided. It will not work the way you want it to. You will need a custom post template designed specifically for infinite loading. If you really need this customization we suggest you hire a freelancer from sites like studio.envato.com as there is no simple solution we can provide for infinite loading. Sorry.

Thanks.

Post count: 436

I understand. Thank you for looking at this issue. I believe that you guys will surely work on some similar feature in the future.

Thank you.

Post count: 4

BTW, we wrote our own little plugin to create a “scroll to next post” feature on pages that show full posts (many of our users prefer to see full posts rather than excerpts)

https://goo.gl/ZB8iwP

Let me know if we should publish the plugin on github or sell it somewhere

I wonder if anyone else will notice the other custom functions we wrote for this site to work with tagdiv modules & functions

Post count: 436

Hi JackV, I checked your site. Your plugin seems nice but it provides a totally different solution. You are simply displaying all posts on one page and hence display full posts rather than excerpts.

– But our main purpose it to get more Post views and hence more traffic. Your plugin, on another hand, will decrease the page views.

But, this plugin is still nice and come in use for some specific case. You may submit it on WordPress or sell it otherwise.

Thank you.

Viewing 7 posts - 1 through 7 (of 7 total)
The forum ‘Newspaper’ is closed to new topics and replies.