Permalinks for WooCommerce Categories and Subcategories

Setup Desired permalink structure (only these structures exist for products) Product 1: /shop/category/subcategory/product1/ Product 2: /shop/category/product2/ Woocommerce Product View Settings View for shopbase: Show categories View for categories: Show products Products Products are only checked for one category OR subcategory Permalink Settings Normal settings: /%category%/%postname%/ Base for categories: shop For products: /shop/%product_cat%/ Archives Since there … Read more

WordPress edit_user_profile_update update secondary role

I am trying to save secondary role field in user-edit.php which is independent of WP’s main roles. I had no problem with saving other custom fields that are unique but for roles (wp_capabilities), it looks like it first saves my roles (I set sleep(10) to check in database in the process) and at the end of request, WP saves main role field which overwrites my previously saved role.

get_posts – get all posts by author id

I want to get all posts by certain author id (current user). Later, I want to pick the first post made by this user (ASC).
I guess I do not use the right arguments in get_posts, am I? $current_user_posts
always contains an Array with all blog posts in multiple different WP_Post Objects.

500 error when using virtual host

I’ve got a WordPress MU install in a sub-directory of my webserver. When I point my virtual host at that directory I get my index page but no styling or access to any pages. It’s like it can’t access anything in the sub-directories of my WP root, I get the 500 error. When I check the Apache log it says,