Check if new post or update before save_post action

You can achieve this by using the wp_insert_post hook, which is called before the post is saved or updated. Inside this hook, you can check if the post ID exists to determine if it’s an update or a new post. Here’s how you can do it: add_action(‘wp_insert_post’, function ($post_ID, $post, $update) { if (!$update) { … Read more

How to control page order for category links

The built-in solution to change the order of posts in a category is to change the “Order” attribute of each post. If your post type is set to support “Post Attributes”, you should have a box that looks like this in your right sidebar when editing the post: 0 will be the first in the … Read more