“Author” custom post type
“Author” custom post type
“Author” custom post type
Adding plugin editing capability for Author
To check if s/he is the right author, you can use is_author() function using the author id or name as parameter. And, depending on how you set up the settings for displaying author box or last updated. You can put your settings. I am considering your settings are in options table. So I will use … Read more
Author & date removal
i needed something similar to this so i added a rewrite rule to the same author.php file and there i added a redirect based on the user role, so to put this in your use case: First redirect editor to your theme author.php file by adding this rewrite rule function my_rewrite_rules_098( $wp_rewrite ) { $newrules … Read more
The variable is not valorize: $current_user->ID is 0, so the query extracts all post, try to give it a non existent integer value Try to substitute $current_user->ID with ($current_user->ID==0) : -1 ? $current_user->ID It assign -1 to the author, if there is no user. So the query must return no results!
a similar question was asked before, if you take a look here obviously for 1 column use ‘post_status’ => ‘published’ and for the other column call ‘post_status’ => ‘draft’ and set number of posts to show to 8 for each column
This is entirely possible. Though, I would recommend using the Post custom metadata (i.e. custom fields, or better yet, a custom metabox). I would use a custom metabox, with two radio select options: Byline: (*) Author ( ) None Then, in your template file, you can output the author byline only if the appropriate post_meta … Read more
When you’re in the loop, you can use get_the_author() to get the author’s ‘Public’ name. Alternatively, you can use get_the_author_meta( ‘ID’ ) in the loop to get the author ID. So, modifying your psuedo-code: if ( 2 == get_the_author_meta( ‘ID’ ) ) { echo ‘<h2>John’s Perspective</h2>’ }
You can use a simple custom field and tweak your template a little, for example say you call that custom filed “original_author” then your theme you need to replace <?php the_author(); ?> with: <?php echo get_post_meta($post->ID,’original_author’,true); ?>