When I choose category from dropdown then everything working fine.But in backend it checked only child not parent [closed]

You can add custom columns in wp-admin to show parent category. It’s here my code, you can try it (I tested with post_type is post (default)). // Add the custom columns to the post post type: add_filter( ‘manage_post_posts_columns’, ‘set_custom_edit_post_columns’ ); function set_custom_edit_post_columns($columns) { $columns[‘parent_cat’] = __( ‘Parent Category’, ‘storefront’ ); return $columns; } // Add … Read more

Creating shortcode id for custom post types

Please replace the following code $string .= ‘<li>’ . get_the_title() . ‘</li>’;. to: $string .= ‘<li>’; $string .= ‘<figure>’ . get_the_post_thumbnail( null, ‘thumbnail’ ) . ‘</figure>’; $string .= ‘<h2>’ . get_the_title() . ‘</h2>’; $string .= ‘<div>’ . apply_filters( ‘the_content’, get_the_content() ) . ‘</div>’; $string .= ‘</li>’; Hope it’ll work just fine.

Copy order items with metadata between orders – Woocommerce

Just change the $item_id to $to_order_item_id and you don’t even have to touch the order_item_meta since it is still associated with the proper $item_id. So your foreach from above would be … foreach($order->get_items() as $item_id=>$item) { wc_update_order_item($item_id, array(‘order_id’=>$to_order_item_id)); } Then you could even calculate the new totals of both orders after by using … $original_order … Read more