How do I allow certain users to make a certain type of post?

The following will assign capability requirements to your CPT. So, users will require edit_community, delete_community etc capabilities to perform those actions. function createCommunityPostType() { $args = array( ‘public’ => true, ‘label’ => ‘Community’ ‘capability_type’ => ‘community’, ‘map_meta_cap’ => true ); register_post_type(‘community’, $args ); } add_action(‘init’, ‘createCommunityPostType’); See the parts about capabilities in the codex. You … Read more

Is that possible put a whole POST in a list ,

Yes if (have_posts()) : while (have_posts()) : the_post(); is a loop, so you would just add the tags into it. <ul> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <li> <div <?php post_class() ?> id=”post-<?php the_ID(); ?>”> <h2><a href=”https://wordpress.stackexchange.com/questions/95763/<?php the_permalink() ?>”><?php the_title(); ?></a></h2> <div class=”entry”> <?php the_content(); ?> </div> <div class=”postmetadata”> <?php the_tags(‘Tags: ‘, … Read more

Get only X number of categories

After reading your question (and comment) again, this could be what you want to do: $X = 3; // for instance ob_start(); the_category(); $cats = implode(‘<li’, array_slice(explode(‘<li’, ob_get_clean()), 0, $X+1)); If you want to use this throughout your theme multiple times, use a function. Put the following in your functions.php: function my_the_category($limit) { $limit++; ob_start(); … Read more

Count user posts and store the number for later use

You can use update_user_meta() to add information to a user’s meta fields, and count_user_posts() to get an initial count. So, for instance: <?php add_action( ‘new_to_publish’, ‘wpse96358_author_count’ ); add_action( ‘draft_to_publish’, ‘wps396358_author_count’ ); function wpse96358_author_count() { global $post; // get initial count $single = true; $author_count = get_user_meta( $post->post_author, ‘author_count’, $single ); if ( strlen( $author_count ) … Read more