How can I add an author-box below a post?
How can I add an author-box below a post?
How can I add an author-box below a post?
Instead of using get_current_user_id() use $current_view = get_queried_object(); The $current_view will have the same properties as get_current_user() if it is used in author.php. To get the User ID, just use $current_view_id = $current_view->ID Hope this help
As mentioned by @mridul-aggarwal WordPress supports author pages with the author.php template (Author_Template). If you are setting up a custom template you will need some method of letting the template discover which user is supposed to be displayed, this is usually done via a POST/GET request or in the URI http://example.com/path/to/user/username which you can then … Read more
Advanced author permalinks
Change base URL of pages created by certain users
the solution: function parse_query_useronly( $wp_query ) { if ( is_admin() && strpos( $_SERVER[‘REQUEST_URI’], ‘/wp-admin/edit.php’ ) !== false ){ $wp_query->set( “location”, get_user_role_location()); } } add_filter(‘parse_query’, ‘parse_query_useronly’ );
<?php $curauth = (isset($_GET[‘author_name’])) ? get_user_by(‘slug’, $author_name) : get_userdata(intval($author)); ?> <?php if ( have_posts() ) ?> <h2>Posts by <?php echo $curauth->nickname; ?>:</h2> <ul> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <li> <a href=”https://wordpress.stackexchange.com/questions/106902/<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link: <?php the_title(); ?>”> <?php the_title(); ?></a>, <?php the_time(‘d M Y’); ?> … Read more
Co-Authors Plugin Displaying Wrong Author
How to change the Author Slug from Username to Nickname and deal with Special Characters
I used your code and tested the CPT with an author account.The option to add a featured image showing up just fine. So just a heads up that the issue is not related to that specific CPT snippet, you should look elsewhere. Maybe a functions.php cleanup, disable plugins and/or try another theme using the snippet … Read more