The reverse of wp_insert_post

You’re looking for wp_delete_post. <?php $some_post_id = 1; wp_delete_post($some_post_id); The above will delete the post with ID 1 — well, it will actually set it to a “trash” status. You can delete the post for real by setting the second parameter of wp_delete_post to true. <?php $some_post_id = 1; wp_delete_post($some_post_id, true); // really deletes the … Read more

Child theme:Loading js files

The reason why your code isn’t working is because bloginfo() echoes the data where get_bloginfo() doesn’t. So dirname() isn’t really used. Using stylesheet_directory is better though since that won’t need the dirname() call at all. You could also use the wrapper get_stylesheet_directory_uri() which adheres to the filter stylesheet_directory_uri. This is your code corrected: <script type=”text/javascript” … Read more

post_count not working

post_count is not a parameter of WP_Query argument. post_count is a property used to get the number of posts being displayed. For example, echo $my_related_posts->post_count; will display the number of posts being displayed.