New answers tagged

0

You could have saved yourself a ton of work and just used the Co-Authors Plus plugin. It has a guest author function. You do have to set them up, but there is no account/password for them, and they can have author pages. (I am not affiliated with them, just use it on several sites.)


0

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; }


0

I found it :D 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', ...


1

In author.php: <?php get_template_part('custom-author-file'); Alternatively, rename your custom-author-file.php to author.php. The URL being used in this case isn't relevant, as a template doesn't determine the URL used, it's the other way around. However, I suspect there is more to your question you haven't explained


1

Solved I've solved the problem and I'm going to share the code I used, so other developers that have this issue too can cope with it. The get_pages()-function accepts the "hierarchical" argument. By default it's set to 1 (true), which means, that Wordpress searches the pages in hierarchical order to find the other parameters. If - as in my case - you ...


-1

In your case this could work: <?php $user_info = get_userdata($recent["post_author"]); echo $user_info->user_login; ?>


0

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 ...


0

You can get author posts id's ids =[] ids = SELECT id FROM `wp_posts` WHERE `post_author`=1 and then you can loop result new_category_id = 999 old_category_id = 111 for id in ids: UPDATE `wp_term_relationships` SET `term_taxonomy_id`=new_id WHERE `object_id`=id AND `term_taxonomy_id`=old_category_id or wp_set_post_categories( $post_ID, ...



Top 50 recent answers are included