{"id":1512,"date":"2017-04-20T03:31:19","date_gmt":"2017-04-20T03:31:19","guid":{"rendered":"http:\/\/docs.contentviewspro.com\/?p=1512"},"modified":"2023-12-29T04:13:49","modified_gmt":"2023-12-29T04:13:49","password":"","slug":"show-authors-co-authors-plus-plugin","status":"publish","type":"docs","link":"https:\/\/contentviewspro.com\/documentation\/article\/show-authors-co-authors-plus-plugin\/","title":{"rendered":"Show all authors of Co-Authors Plus plugin"},"content":{"rendered":"<p>Please add this code to file <strong>functions.php<\/strong> of your active theme:<\/p>\n<pre style=\"font-size:13px\">\n\/\/ Content Views Pro - Show authors by Co-Authors Plus plugin\nadd_filter( 'pt_cv_field_meta_author_html', 'cvp_theme_field_meta_author_html_coauthor', 100, 2 );\nfunction cvp_theme_field_meta_author_html_coauthor( $args, $post ) {\n\n\t\/\/ 1. To show author name and link\n\tif ( function_exists( 'coauthors_posts_links' ) ) {\n\t\t$args = coauthors_posts_links( null, null, null, null, false );\n\t}\n\t\/\/ end 1.\n\n\t\/\/ 2. To show author avatar and link\n\tif ( function_exists( 'get_coauthors' ) ) {\n\t\t$arr = array();\n\t\tforeach ( get_coauthors() as $coauthor ) {\n\t\t\t$avatar\t = get_avatar( $coauthor-&gt;user_email, '60' );\n\t\t\t$link\t = get_author_posts_url( $coauthor-&gt;ID, $coauthor-&gt;user_nicename );\n\t\t\t$arr[]\t = sprintf( '&lt;a href=&quot;%s&quot;&gt;%s&lt;\/a&gt;', esc_url( $link ), $avatar );\n\t\t}\n\n\t\t$args = $arr ? implode( '', $arr ) : $args;\n\t}\n\t\/\/ end 2.\n\n\treturn $args;\n}\n<\/pre>\n<blockquote><p>Depending on your need, please remove the 1. or 2. block in above code.<\/p><\/blockquote>\n<p>Thank you,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Please add this code to file functions.php of your active theme: \/\/ Content Views Pro &#8211; Show authors by Co-Authors Plus plugin add_filter( &#8216;pt_cv_field_meta_author_html&#8217;, &#8216;cvp_theme_field_meta_author_html_coauthor&#8217;, 100, 2 ); function cvp_theme_field_meta_author_html_coauthor( $args, $post ) { \/\/ 1. To show author name and link if ( function_exists( &#8216;coauthors_posts_links&#8217; ) ) { $args = coauthors_posts_links( null, null, null, &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/contentviewspro.com\/documentation\/article\/show-authors-co-authors-plus-plugin\/\"> <span class=\"screen-reader-text\">Show all authors of Co-Authors Plus plugin<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"doc_category":[62],"doc_tag":[32,21,30],"class_list":["post-1512","docs","type-docs","status-publish","hentry","doc_category-other-plugins","doc_tag-author","doc_tag-custom-code","doc_tag-meta-fields"],"year_month":"2026-09","word_count":150,"total_views":"2","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"admin1","author_nicename":"admin1","author_url":"https:\/\/contentviewspro.com\/documentation\/author\/admin1\/"},"doc_category_info":[{"term_name":"Other Plugins","term_url":"https:\/\/contentviewspro.com\/documentation\/cats\/other-plugins\/"}],"doc_tag_info":[{"term_name":"author","term_url":"https:\/\/contentviewspro.com\/documentation\/tags\/author\/"},{"term_name":"custom PHP code","term_url":"https:\/\/contentviewspro.com\/documentation\/tags\/custom-code\/"},{"term_name":"meta fields","term_url":"https:\/\/contentviewspro.com\/documentation\/tags\/meta-fields\/"}],"_links":{"self":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/1512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/comments?post=1512"}],"version-history":[{"count":1,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/1512\/revisions"}],"predecessor-version":[{"id":5355,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/1512\/revisions\/5355"}],"wp:attachment":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/media?parent=1512"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_category?post=1512"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_tag?post=1512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}