Need Quick Help With Product Category Page

For Woocommerce product categories, use <?php if ( is_product_category() ) { echo ‘<div id=”prodcatdesc”>’; if ( is_product_category( ‘shirts’ ) ) { echo ‘Hi! Take a look at our sweet tshirts below.’; } elseif ( is_product_category( ‘games’ ) ) { echo ‘Hi! Hungry for some gaming?’; } else { echo ‘Hi! Check our our products below.’; … Read more

Changing second user role while updating/downgrading membership level – s2member [closed]

I found a solution. Here it is: //Update Roles automatically when Membership Level changes function rb_update_user_role( $user_id) { $user = new WP_User( $user_id ); $user_meta=get_userdata($user_id); $all_role = $user_meta->roles; foreach ($all_role as $role_value){ if ($role_value === ‘vendor’){ $user->remove_role( ‘vendor’ ); } if ($role_value === ‘customer’){ $user->remove_role( ‘customer’ ); } if ($role_value === ‘s2member_level1’){ $user->remove_role( ‘s2member_level1’ ); … Read more

Woocommerce Custom Rewrite Rules Array – Subcategories

Try this add_filter( ‘rewrite_rules_array’, function( $rules ) { $new_rules = array( ‘services/([^/]*?)/page/([0-9]{1,})/?$’ => ‘index.php?product_cat=$matches[1]&paged=$matches[2]’, ‘services/([^/]*?)/?$’ => ‘index.php?product_cat=$matches[1]’, ‘services/([^/]*?)/([^/]*?)/?$’ => ‘index.php?product_cat=$matches[2]’ ); return $new_rules + $rules; } );

Display SOLDOUT text in Dropdowns of Variable Product in WooCommerce [closed]

Step 1: Add below code to variable.php file located in woocommerce plugin (single-product/add-to-cart) <?php $product_variations = $product->get_available_variations(); echo ‘<ul class=”attr_avail_custom dnone”>’; foreach ($product_variations as $variation) { $var_data = $variation[‘attributes’]; if(!$variation[‘is_in_stock’]) { echo ‘<li>’; foreach ($var_data as $vk => $vv) { echo “<span data-key=$vk data-value=$vv >$vv</span>”; } echo ‘</li>’; } } echo ‘</ul>’; ?> Step 2: … Read more

WordPress search form and search result through ACF field in custom taxonomy

This should hopefully help you on your way, although I’ve not fully tested it… The basic search form here which will load the site_url() with appended search query string. You should change this to better reflect your site layout such as <?php site_url( ‘search’ ); ?> (‘http://website.com/search‘). Place the Results page code within the results … Read more