Hide load more button if no more post in selected category

I believe you should pass one more label “How many posts remain to be seen” in your $response array in function filterPosts() You know the total number of posts based WP_Query that exist in the database $filter_query = new WP_Query($filter_args); $total_query_posts = $filter_query->found_posts; So, then you have to calculate it based on paged and posts_per_page, … Read more

Set custom post title to read only by user

For gain result custom post titles read-only for all users except the admin, you can use the edit_post capability along with the admin_init hook. add_action(‘admin_init’, ‘restrict_custom_post_title_editing’); function restrict_custom_post_title_editing() { // Check if the current user is not an admin if (!current_user_can(‘administrator’)) { // Get the post types for which you want to restrict title editing … Read more