Create a Page Template Which Displays All Posts by Current User

Working code: <?php if (is_user_logged_in() ) : ?> <?php //if a certain page, then display posts authored by the logged in user $page_title=”Support History”; if ( is_user_logged_in() && is_page($page_title) ) { global $current_user; get_currentuserinfo(); $args=array( ‘author’ => $current_user->ID, ‘post_type’ => ‘post’, ‘post_status’ => ‘publish, private’, ‘posts_per_page’ => -1, ‘caller_get_posts’=> 1 ); $my_query = null; $my_query … Read more

One of my posts is displayed as page

It seems that http://www.regensburgerturmtheater.de/loriotabend/ page is an attachment view page. I recommend you just change the name of this http://www.regensburgerturmtheater.de/wp-content/uploads/Loriotabend.jpg photo to different (in admin panel).

how to show posts on different pages if number of post per page is one

First of all, never use query_posts(), use WP_Query() instead. (Learn More) With your WP_Query() use paged parameter in the argument array, like: <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args = array( ‘posts_per_page’ => 1, ‘paged’ => $paged ); $cat_query = new WP_Query( $args ); ?> And for the pagination link, go with: <?php … Read more

Custom filter on all post page (admin backend)

Use the restrict_manage_posts action to add other HTML content beside the Category/Date dropdown filters. Try something simple like: add_action( ‘restrict_manage_posts’, ‘my_posts_restrictions’ ); function my_posts_restrictions() { echo ‘xxxxx’; } This should give you xxxxx at the end of yoru filters line. Be warned, as this will appear on any Custom Post Types as well. You need … Read more

Add a minimum word count to Excerpt (and how to force Excerpt as a rule for WyPiekacz)

Add minimum word count to Excerpt field To enforce a minimum word count for the Excerpt field before the Post status can be changed to pending, we will slightly alter s_ha_dum‘s code. It can be done by filtering wp_insert_post_data: function wcexcerpt($data){ if (!current_user_can(‘edit_others_posts’)) { $num = 5; // minimum word count if (str_word_count($data[‘post_excerpt’]) < $num) … Read more