How we retrieve the ‘tags’ and ‘attachment’ of the custom post which is created by wp_insert_post();

You can use: $post_id = wp_insert_post($args); to get the ID of the inserted post. You can try this: $terms = wp_get_object_terms($post_id, ‘thread_tag’); to get the terms from your post with $post_id. You can check out the Codex: http://codex.wordpress.org/Function_Reference/wp_get_object_terms You can then use get_children() $args = array( ‘post_mime_type’ => ‘image’, ‘post_parent’ => $post_id, ‘post_type’ => ‘attachment’ … Read more

wp_set_object_terms() without accents

Just thought I’d point out, your call to remove_accent() is incorrect, you are missing the s off of accents. Example from codex: $text = “Hoy será un gran día”; echo remove_accents($text); Echo result: Hoy sera un gran dia https://codex.wordpress.org/Function_Reference/remove_accents

get_terms() – unexpected ‘=>’ (T_DOUBLE_ARROW) error

This is a PHP syntax error. You’re attempting to pass an array to get_terms() but haven’t used array() or [] to make it an array. This means that => is invalid here. The code should be: public function pggggo_list_of_terms() { $terms = get_terms( [ ‘taxonomy’ => [ ‘vehicle_safely_features’, ‘vehicle_exterior_features’, ‘vehicle_interior_features’, ‘vehicle_extras’, ], ] ); return … Read more

Attempting to filter posts using get_terms

Have you tried out isotope? I am working on a project that needs a similar function. So far it’s the closest I’ve found that will sort/filter posts. The link – http://isotope.metafizzy.co/ Here’s some questions I had about implementing it with wordpress, and was able to do so to certain extent. It can help get you … Read more