WordPress Shop and restricting products and categories for some users/groups

Essentially, you need: A global role-category relationship list, and/or… A per-user category list For per-user categories, hook onto the relevant profile actions: show_user_profile & edit_user_profile for displaying the field (use wp_terms_checklist()) personal_options_update & edit_user_profile_update for saving the data For the role-category data, use an options page. Loop over all roles ($wp_roles->roles) with a term checklist … Read more

Alphabetize all but one category

Add an else to the condition along with adding the excluded category id in the is_category() call. You will also need to include/exclude that particular category depending on the condition that is true: NOTE: you probably want to avoid using query_posts and use WP_Query() Reference here <?php if (is_category(15)) { $posts = query_posts($query_string . ‘&orderby=date&order=asc&cat=15’); … Read more

How to add a new child category via an SQL statement?

Insert taxonomy terms via a raw SQL query is hard and discouraged, use the core wp_insert_term function, instead. Assuming you have an array of continent/countries terms: $countries_list = array( ‘Europe’ => array( ‘Austria’, ‘France’, ‘Italy’, ‘Germany’, ‘Spain’, ‘United Kingdom’ ) ); foreach ( $countries_list as $continent => $countries ) { // get term object for … Read more

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