How to display all terms from all taxonomies in post, but separately for each taxonomy?

You can get the taxonomies that are registered for a post type with get_object_taxonomies(). If you pass the post object directly, you don’t even need to explicitly name the post type either. You can then loop through the result of that function to achieve the result you want: $taxonomies = get_object_taxonomies( $post ); foreach ( … Read more

Search for single post by 2 tags

Using the tax_query param in your args (and replacing the dot with a comma) should get you what you’re looking for: $args = array( ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘post_tag’, ‘field’ => ‘slug’, ‘terms’ => ‘fetch’, ), array( ‘taxonomy’ => ‘post_tag’, ‘field’ => ‘slug’, ‘terms’ => ‘agirt’, ) ) );

editing shortcode for custom post type within a plugin

In your code $atts is always $atts = [ ‘category’ => ” ], you cannot use ‘terms’ => $atts, in query parameters $query_args. [litters category=”first_slug,second_slug”] You can assign to ‘terms’ in ‘tax_query’ parameter a string (single category) or an array (multiple category). $args[‘category’] is passed to the shortcode function as string, so you need to … Read more

Allow users to upload attachments to certain posts

One way to do this might be with a plugin such as Gravity Forms, they allow you to create posts from a form, you can upload images too. They have an add on that helps you with this: https://www.gravityforms.com/add-ons/advanced-post-creation/ You can also see a bit more on this information here: https://fewerthanthree.com/tutorial/using-gravity-forms-multi-file-uploads-when-creating-a-new-post/ There might be other … Read more