New answers tagged author
@Rapforthemoment - I do not have your current code. If your question contained that then it would have helped. Well, below code would help you to show the bio: <?php echo xprofile_get_field_data( 'Author Bio', get_the_author_id()); ?> Please note, you will need to replace 'Author Bio' with actual field name in your case or the field ID.
For simplicity and relevancy between this question and another question asked on Stack Overflow (wordpress - manually set the author of a post in php -- As linked by OP here on WPSE.). WordPress seems to force a value for the post_author while inserting or updating posts using wp_insert_post() and wp_update_post(). The way around it is to use the filter ...
I suggest you take a look at: https://codex.wordpress.org/I18n_for_WordPress_Developers You should probably just use a get_text function such as $author = __('Author');
The function is_author() is used to check if you are on the archive page for the specified author. So as your code is in single.php this will never be true. From the docs This Conditional Tag checks if an Author archive page is being displayed. This is a boolean function, meaning it returns either TRUE or FALSE. ...
If you want to exclude ALL pages that doese't have 'collaborator' set as author, then you want to exclude all other pages in the site and include all pages of that author minus, maybe, some hand picked pages of that author, then I think you can use this: add_filter('acf/fields/relationship/query/name=products', 'exclude_id', 10, 3); function exclude_id ( ...
You should declare your desired capabilities when you are registering the post type. Justin's article here is a good one for custom post types: http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress When you are registering your custom post type, you can set this to be standard capabilities for posts, eg: 'capability_type' => ...
It shouldn't be any problem. Try this: $arg = array( 'ID' => $post_id, 'post_author' => $user_id, ); wp_update_post( $arg );
You can get the current user ID using $user_id = get_current_user_id(); and use the $user_id in your query. $user_id = get_current_user_id(); $loop = new WP_Query( array( 'post_type' => 'html5-blank', 'category_name' => 'chapter', 'author' => $user_id ) ); if ( $loop->have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post(); ...
The shortest possible answer would be to correct 'post_author' to 'author', since that is the key WP is looking for. If a key is incorrect or misspelled it will be ignored, as was the case with 'post_author'.
Top 50 recent answers are included