Bulk author change in wordpress

If you want to do a bulk author change in wordpress here is the How:

Select the posts you want to change, select Edit from the “Bulk Actions” dropdown menu and then click Apply, make changes and then click “Update”

and here are some tips:

  1. disable google dashboard, I found mine would not work with it enabled. Thanks to: http://jamflying.info/2010/10/28/bulk-change-post-author-in-wordpress/
  2. Increase the posts shown per page(in screen option at the top) – tried 100 with success, 200 was too much for my server.
  3. You can use shift click to grab a range of post or the top left box to select all on screen.
  4. Be careful not to include posts you do not want to include, after a bit of clicking around you can find yourself in all posts without knowing it.

Moving the meta-entry to top of post

In this case I wanted to list author, categories and tags at the top of each post in a list and by itself. I am modifying a the “Twenty Eleven” theme in wordpress.

I tracked down the php i needed to modify in wp-content/themes/mytheme/

  • content-single.php (for single posts)
  • category.php (for the category lists/loops)
  • content.php (the default)

I copied the code from the footer and placed it in on top of (getting rid of it):

<?php //twentyeleven_posted_on(); ?>

which is just under <div class=”entry-meta”>

The code:

/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ‘, ‘, ‘twentyeleven’ ) );

/* translators: used between list items, there is a space after the comma */
$tag_list = get_the_tag_list( ”, __( ‘, ‘, ‘twentyeleven’ ) );
if ( ” != $tag_list ) {
$utility_text = __( ‘Posted in %1$s and tagged %2$s by <a href=”%6$s”>%5$s</a>.’, ‘twentyeleven’ );
} elseif ( ” != $categories_list ) {
$utility_text = __( ‘Posted in %1$s by <a href=”%6$s”>%5$s</a>.’, ‘twentyeleven’ );
} else {
$utility_text = __( ‘Posted by <a href=”%6$s”>%5$s</a>.’, ‘twentyeleven’ );

esc_url( get_permalink() ),
the_title_attribute( ‘echo=0′ ),
esc_url( get_author_posts_url( get_the_author_meta( ‘ID’ ) ) )
<?php edit_post_link( __( ‘Edit’, ‘twentyeleven’ ), ‘<span class=”edit-link”>’, ‘</span>’ ); ?>

<?php if ( get_the_author_meta( ‘description’ ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?>
<div id=”author-info”>
<div id=”author-avatar”>
<?php echo get_avatar( get_the_author_meta( ‘user_email’ ), apply_filters( ‘twentyeleven_author_bio_avatar_size’, 68 ) ); ?>
</div><!– #author-avatar –>
<div id=”author-description”>
<h2><?php printf( esc_attr__( ‘About %s’, ‘twentyeleven’ ), get_the_author() ); ?></h2>
<?php the_author_meta( ‘description’ ); ?>
<div id=”author-link”>
<a href=”<?php echo esc_url( get_author_posts_url( get_the_author_meta( ‘ID’ ) ) ); ?>” rel=”author”>
<?php printf( __( ‘View all posts by %s <span class=”meta-nav”>&rarr;</span>’, ‘twentyeleven’ ), get_the_author() ); ?>
</div><!– #author-link –>
</div><!– #author-description –>
</div><!– #entry-author-info –>
<?php endif; ?>

previous_posts_link, next_posts_link, custom post types and pain

I have spent possible over a day try to get a link to navigate through multiple custom posts in WordPress. I have tried a great many things and in the end it was so simple. If your previous and next link are not even showing up and you have embedded the php into the template try this:

<?php previous_posts_link('&laquo; Previous', '1000')

I think the WP_query is not able to pass on the the max number of pages so this sets it to a generous 1000. (Forum post here)

UPDATE: This is far from ideal as having too many pages means extra blank pages and too few means missing content.

There are other things I implemented, such as entering arg in an array for “post_type” and “paged” but because nothing happened until I added the 1000 I feel it was the key to everything. Other things to look out for is the difference between

previous_posts_link and previous_post_link.

This is the beginning of my loop I am using for my custom post types:

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
 $loop = new WP_Query( array(
 'post_type' => 'videos',
 'posts_per_page' => 2,
 'orderby'=> 'menu_order',
 ) );

 $loop = new WP_Query( $args );
 while ( $loop->have_posts() ) : $loop->the_post(); ?>