Posts page only shows one post

As noted in a comment above, apparently the theme I use in one of its updates required the Options Framework plugin. Without it, a certain function was undefined. Thus the error and the breaking of the posts page. Installing the plugin solved the issue.

How can I remove posts of a certain category from homepage after a specified time period?

This looks straightforward, but unfortunately isn’t, because wp_query doesn’t allow you to exclude posts on basis of multiple arguments (in this case category and date). You can select on basis of multiple arguments, but not exclude. So, to do what you want, you must in some way bundle your two arguments into one. Conceptually, you … Read more

Getting a 404 error when clicking edit page

You mentioned that you disabled all plugins, and changed the theme (I assume you used one of the ‘twenty’ themes, which is what I usually do when trying to find theme/plugin problems). Did you also look at the ‘must use’ plugins (in wp-content/mu-plugins ) (see https://codex.wordpress.org/Must_Use_Plugins ). Maybe a plugin in there is causing problems. … Read more

Setting up navigation links for posts (first, prev, next, last)

This gist should get you started. <?php /* Plugin Name: Easy Pagination Deamon Plugin URI: http://wordpress.org/extend/plugins/stats/ Description: Offers the deamon_pagination($range) template tag for a sematically correct pagination. Author: Franz Josef Kaiser Author URI: http://say-hello-code.com Version: 0.1 License: GPL v2 – http://www.gnu.org/licenses/old-licenses/gpl-2.0.html Text Domain: pagination_deamon_lang Copyright 20010-2011 by Franz Josef Kaiser This program is free software; … Read more

AJAX filter posts by year

Try by change appropriate code: Front end <form action=”<?php echo site_url()?>/wp-admin/admin-ajax.php” method=”POST” id=”filter> <select name=”year”></select> <input type=”hidden” name=”action” value=”filter” /> </form> JS ajax request $.ajax({ url : filter.attr(‘action’) , data : filter.serialize() , type : filter.attr(‘method’) , success : function (response) { console.log(response) }, error : function (request , status , error) { console.log(request.responseText) console.log(error) … Read more

How do I use `posts_distinct` correctly?

You can see a practical example here: https://wordpress.stackexchange.com/a/142902/19105 Why do you need to use DISTINCT in this situation though? The WP_Query you provided shouldn’t be giving duplicates unless there is a plugin causing trouble. But I’ll try to answer it anyway. I would suggest keeping the function in functions.php. But move the filter to archive.php … Read more