Looks fine to me @radiocure1 . Try enabling the JavaScript to run in the footer instead. You can find the option under Misc in the ALNP settings. You may also need some tweaking with Autoptimize plugin.
Thread Starter
Tnace
(@radiocure1)
Hi Sebastien,
I enabled JS to run in the footer for ALNP and temporarily disabled Autoptimize but it’s still not working. I believe the content container should be main>.inner instead. I’m not sure why the “>” is in there, but when I inspect the container it has the greater than sign. Also, when I switched from main.inner to main>.inner the styling of the pagination changed. Any other ideas on why it’s not working?
For your theme it appears you need to either filter the location of the template or override the repeater template.
See the general overview guide in the documenation for more.
What theme are you using by the way?
Thread Starter
Tnace
(@radiocure1)
I’m using this theme: https://swiftthemes.com
I’ll work on the guide. What do you mean by filter the location of the template? Do you mean my theme’s single post template?
for future reference; for debugging-purposes you can also disable Autoptimize on a per-request basis by adding ?ao_noptimize=1
to the URL 🙂
frank (ao dev)
Thread Starter
Tnace
(@radiocure1)
Hi Sebastien,
So I got it to work by adding the code below to my functions.php file. However, it doesn’t load the entire new article, just the title, featured image and an excerpt that says “read more” however the url is for the new post. Do you know why it’s not loading the full post?
function my_template_location() {
return 'template-parts/';
}
add_filter( 'alnp_template_location', 'my_template_location' );
Thread Starter
Tnace
(@radiocure1)
Thanks @optimizingmatters, I didn’t realize that!
Thread Starter
Tnace
(@radiocure1)
I think the issue is that the template-parts/
folder has lots of template php files. Perhaps the plugin is just pulling the first one which is content-archives.php. Here’s a screenshot: http://tinypic.com/r/330xtuh/9
I tried to update the functions.php code to the following it breaks the auto load next post:
function my_template_location() {
return 'template-parts/content-post.php';
}
add_filter( 'alnp_template_location', 'my_template_location' );
Any ideas on how to make the plugin load the full post not just excerpts?
@radiocure1 The first time round was correct. This filter is just for the location not the file. The repeater template loads the correct file if it exists which it does. The problem is that your theme is loading only the excerpt.
Thread Starter
Tnace
(@radiocure1)
Any idea on how to get the theme to load the full post?
I will take a look at the theme.
I’m sorry but this is a public forum and can not mark replies private.
Thread Starter
Tnace
(@radiocure1)
Np, edited the previous reply.
I have a patch coming that will help detect another template file which helps the repeater template but this theme has some JavaScript issues that prevent any other JavaScript from running including ALNP so I don’t know if after the patch ALNP will work for you until the theme author has resolved the error issues.
The filter I gave you however does work with the coming patch.