WooCommerce REST API AJAX Auth – 401 response

First off, the WooCommerce REST API documentation is available here and you should check it out. Secondly, the examples below are using the /wc/v3/products/categories (“List all product categories“) endpoint. And here’s a proper way to authenticate your request using OAuth — it always works when authenticating over HTTPS and it is the only accepted option … Read more

How to update post content of all posts with tag?

You can loop through each of the $posts and update the post_content with update_post_meta. <?php foreach( $posts as $p ) { update_post_meta( $p->ID, ‘post_content’, ‘YOURCUSTOMEDITS’ ); } ?> edit: if you want to use wp_update_post, it’d look like this: <?php foreach( $posts as $p ) { $my_post = array( ‘ID’ => $p->ID, ‘post_content’ => ‘New … Read more

Trying to show the category of a post in the post display

Use the_category(); on your template. It also supports $separator parameter so you can use your desired separator. Example: <?php the_category( ‘, ‘ ); ?> will separte categories with commas. By the look of your theme folder structure, you should add <?php the_category( ‘, ‘ ); ?> on child-theme=>template-parts=>content-excerpt.php. Add it to line 22. If you … Read more