List of authors posts minus very latest

There’s no need for multiple queries – posts are, by default, ordered by most recent. Just apply a classname for the first post on the first page: <article <?php post_class( $wp_query->current_post === 0 && ! is_paged() ? ‘my-awesome-first-post’ : ” ) ?> The first post of the first page will have the class my-awesome-first-post. Update: … Read more

How to get attachements URL from author meta and display them?

I found it 😀 Yeeeeeeeeaaaahhhhhh :)))) This is final code that worked! I explained each level 😉 /* for get author ID use these */ $curauth = (isset($_GET[‘author_name’])) ? get_user_by(‘slug’, $author_name) : get_userdata(intval($author)); $author_id = get_the_author_meta(‘ID’); /* First condition */ if( get_the_author_meta(‘management_certi’, $author_id, true)) { /* get file ID */ $id = get_user_meta( $author_id, ‘management_certi’); … Read more

Changing the Category for all posts of an Author

You could do this with a simple script. IMPORTANT! – Backup your database before doing this & attempt at your own risk. Create a file called changeauthorcat.php in your main WordPress folder. <?php include( ‘wp-config.php’ ); global $wpdb; // Author username $username=”exampleuser”; // New category slug $newCatSlug = ‘examplecategory’; // find the right author $author … Read more

Hook to change Author Info

Apparently “the_author” is an appropriate filter. Also, $author is apparently a universal variable, so this code worked out fine: add_filter(“the_author”, “change_author”); function change_author($author) { $author = “NEW AUTHOR!”; return $author; }

Change author, disable comments, enable trackbacks for all items in library

You have to run SQL query to do this. Put this code into your functions.php once, run your website and then delete it. global $wpdb; $author = 1; $comment_status=”closed”; $ping_status=”open”; $query = sprintf( ‘UPDATE %sposts SET `author` = %d, `comment_status` = %s, `ping_status` = %s’, $wpdb->prefix, $author, $comment_status, $ping_status ); $wpdb->query($query); Or run it directly … Read more

Comments pagination on author page

Make sure you’ve set the paged parameter in your query, below is shown how to do that. <?php $paged = ( get_query_var( ‘paged’ ) ) ? get_query_var( ‘paged’ ) : 1; $args = array( ‘posts_per_page’ => 3, ‘paged’ => $paged ); $the_query = new WP_Query( $args ); ?> For more information about pagination have a … Read more

How to remove author from Social sharing links?

I took a look at your article in the Facebook Debugger and it looks like it is still pulling in this meta tag <meta name=”author” content=”terrance” />. I’m assuming you deleted that from your site’s <head> already as I am not seeing it in the source code for that article. Have you “fetched a new … Read more

Custom author search

Jus add the parameter ‘author__in’=> array( 2, 3, 5 ) to $args and pass the author ID or IDs. You’ll get the results. $args = array( ‘author__in’=> array( 2, 3, 5 ), // array of authors IDs you like to include ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘caller_get_posts’=> 1 ); And I … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)