How do I manage my users post before publish?
What role are you assigning to those users? According to Roles and Capabilities documentation in Codex it should be Contributor for users that are allowed to write posts, but not publish them.
What role are you assigning to those users? According to Roles and Capabilities documentation in Codex it should be Contributor for users that are allowed to write posts, but not publish them.
This is for future askers, Whenever you use query_posts or custom wp_query you should add wp_reset_query(); after your loop or when you are done processing your posts. This little line of code will help in solving pagination issues or in your case rest the global $post the original as before your query.
You can create date.php (you can copy the content for this from archive.php or index.php) in your theme folder which will handle all the “day” pages… <?php get_header(); ?> <div id=”container”> <div id=”content” role=”main”> <?php $day = get_query_var(‘day’); $monthnum = get_query_var(‘monthnum’); $year = get_query_var(‘year’); if ( is_day() ) : ?> <a href=”https://wordpress.stackexchange.com/questions/15424/<?php echo get_day_link($year, $monthnum, … Read more
To add an extra class when there is no title <h1<?php if(!get_the_title()){echo ‘ class=”no-title”‘;}?>><?php the_title();?></h1> Or to only display h1 tags when there is a title <?php if(get_the_title()) { ?> <h1><?php the_title();?></h1> <?php }?>
If I understand correctly- this is an AJAX request, there is no $post var because you haven’t loaded anything from the database in this request. You have to pass both the ID you want to relate it to, and also the ID you want to relate it from, neither exist in the current request.
You can insert the quicktag <!–nextpage–> into a post. Using wp_link_pages() you can generate the pagination links.
The problem is that you misuse the category field. Use a site meta field (array) and a simple checkbox on each post. When a post is saved add its ID to the site meta array, and if the array is longer than 5 drop the last ID from it. The query for featured post will … Read more
A simple way to achieve this would be to do something like the following; <?php $user_id = get_current_user_id(); $post_count = count_user_posts($user_id); if ($post_count >= 50 && $post_count < 100) { // Congratulations you have submitted 50 posts! } elseif ($post_count >= 100) { // etc etc… } else { // do something else, or nothing. … Read more
wp_get_attachment_image_src will return false if there is no image. So before you echo the image add if ($image !=false)
There is no mandatory class name for posts. Many themes use the post_class() if that is needed but you cannot rely on it. To change the output of the_content() add a filter to ‘the_content’.