Custom filters inside a specific category?

I think these should be separate taxonomies. Category is actually a taxonomy in its own right. You would create a taxonomy for each of the filters/drop-downs. This may seem like overkill but i think it will make it easier to work on additional features down the road. Add the following method to your functions.php. Replace … Read more

How can I modify this code to iterate over an array of categories?

In short, yes! $args = array( ‘post_type’ => ‘summerartcamp’, ‘cat’ => 15, //This is for the Morning Group – I’ll have a second loop for the Afternoon Group ‘order’ => ‘ASC’, ‘meta_key’ => ‘_expiration-date’, ‘orderby’ => ‘meta_value’ ); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() /* Make sure you use the method, not … Read more

Display sub categories of a parent product in products – woocommerce [closed]

As a first condition: Have you tried, if you retrieve sub categories at all? $sub_categories = get_terms( ‘product_cat’, $args2 ); echo ‘<pre>’;print_r( $sub_categories ); If you have sub categories, you would still have a problem with your foreach: foreach ($sub_categories as $subcat) { $sub_categories = $sub_categories.$subcat->name.’,’; } You are overwriting $sub_categories with the first time, … Read more

Catch 404 after changing permalink structure from /%postname%/ to /%category%/%postname%/

That happens because WordPress reads your old post name as category name now – and it cannot find that category. Solution: filter 404_template and try to find the post and its permalink. Then redirect. <?php # -*- coding: utf-8 -*- /* Plugin Name: Redirect to category */ add_filter( ‘404_template’, ‘t5_redirect_to_category’ ); function t5_redirect_to_category( $template ) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)