Dynamically count the number of custom post types associated to a custom taxonomy
You have to get them with WP_Query. Creat an array then get the number of posts from found_posts function.
You have to get them with WP_Query. Creat an array then get the number of posts from found_posts function.
Custom post type single page fine for admin, 404 from front
How do I get parameters from the URL?
You can use the wp_insert_post_data filter, and check the post_category array for your category ID. (If $update is false, you’ll know it’s a new post being added, not an existing post being edited.) Something like this should work. add_filter( ‘wp_insert_post_data’, ‘wpse414180_maybe_change_slug’, 10, 4 ); /** * Changes the slug on posts in the Poetry category. … Read more
Cannot attach custom taxonomy term to a custom post type. Post taxonomy terms are not saving
How to change permalink structure off default posts and also CPT’s posts
Remote database access on another wordpress site’s custom post type
I seem to have solved it with the following code which I cobbled together from other answers after searching last 24hrs. It gave an error until I removed the restore_current_blog at the end of the function. As this should only be used by the singular page for the custom post type, I am hoping, it … Read more
WordPress post objects in one parent post object
Create a WordPress loop that shows posts from a custom post type + filters the posts by taxonomies while hiding empty taxonomies