How to solve performance issue caused by custom post type overview with 20k+ custom taxonomy terms
How to solve performance issue caused by custom post type overview with 20k+ custom taxonomy terms
How to solve performance issue caused by custom post type overview with 20k+ custom taxonomy terms
“Tree view” for wp_dropdown_categories() markup
I added a rewrite rule manually. add_rewrite_rule(‘^bar([^/]+)(/[0-9]+)?/?$’,’index.php?bar=$matches[1]’,’top’); right after add_action(‘init’, ‘register_taxonomy_bar’); in functions.php. But WordPress is SERIOUSLY DENSE in translating /bar/foo/ to barfoo?bar=foo and I don’t know how to get around this nonsensical “barfoo” in the path. I also have no idea what it’ll do to paging. Also this has to be defined for each … Read more
Ok, resolved this. I am now registering the taxonomy and terms on the init hook rather than wp_loaded and that seems to have fixed things. I will accept this answer as soon as I can.
For the record I found an answer to this question in the end – I needed to use a meta query rather than a taxonomy query. The correct code ended up being this: $relatedBlogPostArgs = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 1, ‘order’ => ‘DESC’, ‘orderby’ => ‘date’, ‘meta_query’ => array( array( … Read more
Fetch posts list from fist CPT taxonomy term and list under 2. CPT
First thoughts – a custom tax for actors might work. The Taxonomy Images plugin will make adding the headshot easy. I’d maybe make the production a post – or an instance of a CPT – I wouldn’t mess around with CSVs at all. You’d build the table in the post. I would perhaps create a … Read more
It is too specific of a condition for there to be a native way. On other hand this is hardly complicated as simply sorting an array in PHP. You can use usort() with a small custom callback, containing your comparison logic.
Ok, so I’m feeling generous and will add another answer 🙂 This code will run every time a post is created or updated, and it will add a term to your teacher taxonomy with a name that is the same as the post title. add_action(‘save_post’, ‘my_create_teacher_term_from_post’); function my_project_updated_send_email($post_id){ /** Ensure that this is not a … Read more
You have a couple of issues here looking at your code and tags used to tag your question show_posts is wrong. It is depreciated in favor of posts_per_page. Also, it should be showposts. You cannot use showposts and posts_per_page together. You should only use posts_per_page Don’t use camelcase in you custom post type names, they … Read more