Locked/Unlocked in title

Your function will never “get” $post as this is not how functions work. Functions cannot pull anything into itself by itself. If you have debug turned on, you will get a definite bug notice that $post in undefined….. You would need to invoke the $post global inside your function for anything to work that relies … Read more

Lazy Load using WP_Query pagination

Take a look at this rough example. This requires a little bit of adaptation but as a whole, it does what you want – it loads X amount of next posts if user clicks a button which should be below already loaded posts. If you want to automatically load more posts if user scrolls down, … Read more

How to display all posts assigned to some tag?

I would recommend giving the wordpress tag template page a read but the basic idea of what you want to do is something like this: Create a tag.php fileand place it in your template. This file will act like any other wordpress template and allow you to use “The Loop” which will allow you to … Read more

Amend wordpress password function

Why to edit the whole form ? Filters are good because they gives you the current output and you just need to add your string to it then return it back to WordPress. In above example you are not using it so let use it. Example:- add_filter(‘the_password_form’, function( $form ){ $my_html=”<h2><br>Password Protected Area</h2>”; return $my_html … Read more

I want to query posts in monthly basis

First, get the current month and year: $month = int(current_time(‘m’)); $year = int(current_time(‘Y’)); Next, get the posts in this month: $query = new WP_Query( ‘year=” . $year . “&monthnum=’ . $month ); If the query returns empty query the month before and repeat this until you have found a non empty month: while (empty($query)) { … Read more