How can I let users to access plugin functions based on roles?

You can check if current user is an Author (WP-Codex) $current_user_is_allowed_to_edit = false; if ( current_user_can(‘delete_posts’) ) { $current_user_is_allowed_to_edit = true; } And use it in the if-statement at the point where you implement the Live Edit function. Here is the whole code (for user roles): http://pastebin.com/fY7UPcB1 EDIT: Here is the new code (check for … Read more

Exclude category by slug for for each loop

As I already stated, straight from the codex exclude (string) Excludes one or more categories from the list generated by wp_list_categories. This parameter takes a comma-separated list of categories by unique ID, in ascending order As you have stated, you have to use the category slug. To make this possible and dynamic, I think the … Read more

have_posts() return false but count says “3”

I had same problem. According to documentation: The hierarchy for a custom taxonomy is listed below: taxonomy-{taxonomy}-{term}.php taxonomy-{taxonomy}.php taxonomy.php archive.php index.php So, it doesn’t matter witch template file you are using, all of them will generate same issue. When I put in the beginning of template file code var_dump($wp_query);, i found this: public ‘request’ => … Read more

Looping Through Custom Tax Terms and Displaying All Posts For Each

If your things are laid properly, this code will output 10 posts from film CPT, where taxonomy is category-film and it will occur each of the term of that particular taxonomy. I’m not aware about your templating, so lay your layout accordingly. <?php $_terms = get_terms( array(‘category-film’) ); foreach ($_terms as $term) : $term_slug = … Read more