Hi, it is weird because the server should not be causing any issues. I am wondering, have you tried the same configuration with a shortcode? Create a testing page (private) add a shortcode like this:
[nlposts number_posts=1 title_only=false display_type=block blog_id=4]
This should display only the latest posts from Blog ID 4, if it works, then you could try deleting and adding a new widget setting parameters like this:
Number of Posts: 1
Titles Only: No
Display Type: Blocks
Display Blogs: ID 4 (selected)
It should give the same result.
I hope this information helps. Please let me know if this solves your issue.
Best regards,
José SAYAGO.
Thread Starter
Keith
(@sononaco)
The shortcode in the template works:
<?php echo do_shortcode('[nlposts
number_posts=1
blog_id=4
title_only=false
display_type=blocks
auto_excerpt=TRUE
sorting_order=newer
]');
?>
But I’m not sure this is a permanent fix since we have widgets in various places.
If it works, then it means queries are working as expected. It is maybe one of those weird WordPress caching options issues, like the ones affecting permalinks. You could try editing those widgets, just uncheck the “ignore blogs” (as they are ignored once the display blog is used) and just let the Display Blog ID checked. Saving the widget configuration should refresh its options and start working again.
Thread Starter
Keith
(@sononaco)
I thought it was caching as well but caching is not enabled on the site.
I upgraded the plugin to 4.0 to see if the problem persists and it does. Is there a way to clear it from the options table/database manually? Or is there a way to turn on debugging to see what code the widget is producing?
Thread Starter
Keith
(@sononaco)
Quick update — I set “posts per page” to 1 (it was 0) and it showed only the blog and post I wanted. But it also added the pagination at the bottom (though it is set to “no”).
Trying more combos…
Thing with 4.0 is it isn’t completed yet. With caching, I am referring to an issue often related to permalinks, whenever we migrate WP to a new server or change some server configurations, permalink structures get messed up, one way to solve this is saving permalink structures again. I am wondering if it is happening the same with widget configurations.
Network Latest Posts widgets work the same way shortcodes and embedded functions do. They all use the same core function, if shortcodes work, widgets are supposed to output exactly the same results. Have you tried deleting the widget and setting it up again?
Thread Starter
Keith
(@sononaco)
I figured as much.
I just updated the site again from the live version (I’m working on a dev server with a hosts file hack) which has version 3.5.6. The problem is still there.
I have deleted the plugin and reinstalled it and still it’s acting weird — only the widget. There seems to be some voodoo to getting the Display and Ignore blogs settings to work.
Ok, so I did a test on my own Network. I set my widget like this:
Number of Posts by Blog: 1
Display Type: Blocks
Display Blog(s): Selected blog ID 2 for me
Ignore Blog(s): Nothing to Ignore (default)
... Skip to ...
Use Publication Date: Yes
Sort by Date: Yes
Sorting Order: Newest to Oldest
Total Number of Posts: 1
This will display only the latest post from the blog with ID 2. Could you please try setting your widget like this, and let me know if it works?
Thread Starter
Keith
(@sononaco)
You, sir nailed it! Those settings generated the results I was looking for! It had to do with the publication and sorting settings! Thank you!!
Indeed, total number of posts only works when used along with sort by date. This is my fault as I haven’t had the time yet to put proper documentation out there, I’m preparing it for the next major version but it haven’t been easy to finish it yet. Sorry for the troubles it has caused you.
I am glad everything is working as expected now.
Best regards,
José SAYAGO.