Pass list of categories to JS
Pass list of categories to JS
Pass list of categories to JS
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
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
Yes, You can do this functionality by this plugins : wp-media-library-categories media-category-library
How to count the number of monthly archive?
If on Category Page add “active” class?
I don’t know if you solved this yet, but if you did, it would be great to see how you approached it. Here is my approach: The first thing would be is to retrieve the name of the category page you are currently viewing. You would only want to do this on a category page … Read more
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
You can use get_queried_object to return the name of the current category page you are on $cc = get_queried_object(); echo $cc->cat_name; //display the name of current category page
You’ll want to have a look at get_the_terms(). <?php // You need to define the post id from the post you are outputting in the right bar so that the left bar knows how to match up the terms $country = get_the_terms( $post->id, ‘countries’ ) $args = array( ‘post_type’ => ‘side_menu’, ‘posts_per_page’=> 1, ‘tax_query’ => … Read more