subpages are redirecting to the homepage

And there’s no redirection happening in the .htaccess file? You may want to check the control panel at WPEngine and verify that there’s not a redirection setup in their panel. It won’t be a canonical URL issue as that doesn’t affect redirection, only indexing in search engines. If I enter https://stgtrulite.wpengine.com/platform/?123 it redirects to https://stgtrulite.wpengine.com/?123 … Read more

How do I unset category from a product in wordpress by code

To remove all category from a WooCommerce product, you can use the wp_set_object_terms() function. Here is an example of how you can use wp_set_object_terms() to remove categories from a product: // Set the product’s categories to an empty array $categories = array(); wp_set_object_terms( $product->ID, $categories, ‘product_cat’ ); If you want to remove a specific category, … Read more

How to insert a post from a different post type after every nth post

Figured out a solution that works for the issue I was having. This should be able to place an ‘Ads’ custom post type every 3rd post of ‘Articles’ custom post type. <?php // $paged = ( get_query_var( ‘paged’ ) ) ? get_query_var( ‘paged’ ) : 1; $get_posts = new WP_Query(array( ‘post_type’ => ‘articles’, ‘post_status’ =>’publish’, … Read more