{"id":2348,"date":"2023-04-27T22:53:12","date_gmt":"2023-04-27T20:53:12","guid":{"rendered":"https:\/\/www.molongui.com\/help\/?p=2348"},"modified":"2023-04-27T23:27:19","modified_gmt":"2023-04-27T21:27:19","slug":"how-to-modify-authors-list-template","status":"publish","type":"post","link":"https:\/\/www.molongui.com\/help\/how-to-modify-authors-list-template\/","title":{"rendered":"How to modify authors list template"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"2348\" class=\"elementor elementor-2348\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-3527bcee elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3527bcee\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7972c03d\" data-id=\"7972c03d\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b8537eb elementor-widget elementor-widget-text-editor\" data-id=\"b8537eb\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><a href=\"\/authorship\/\" target=\"_blank\" rel=\"noopener\">Molongui Authorship Pro<\/a> allows you easily display a <a href=\"\/help\/how-to-display-an-authors-list\/\" target=\"_blank\" rel=\"noopener\">list of all authors<\/a> in your site. And you have different layouts to choose from. However, you might want to display the list in a very different way.<\/p>\n<p>If you find yourself in such need and you have PHP coding skills, keep reading because this article is for you.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d3cd63f elementor-widget elementor-widget-text-editor\" data-id=\"d3cd63f\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>There is a convenient hook you can use to provide your very own template. The <code>authorship_pro\/authors_list\/template<\/code> filter.<\/p>\n<p>It filters the <strong>full path<\/strong> to the template to load. So you can overwrite the default one like this:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5fb63de elementor-widget elementor-widget-code-highlight\" data-id=\"5fb63de\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-php line-numbers\">\n\t\t\t\t<code readonly=\"true\" class=\"language-php\">\n\t\t\t\t\t<xmp>add_filter( 'authorship_pro\/authors_lists\/template', 'my_authors_list_template' );\nfunction my_authors_list_template()\n{\n   return '\/var\/www\/wordpress\/wp-content\/themes\/my-child-theme\/templates\/molongui-authors-list.php';\n}<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0b7a29e elementor-widget elementor-widget-text-editor\" data-id=\"0b7a29e\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>So your hooked function must return the <strong>full path<\/strong> to your custom template. Obviously, returned value in the code above is just an example.<\/p>\n<p>And which data do you have available? Basically, you have the <code>$authors<\/code> variable, which is an array of arrays, each one containing data for a different author. But you better check out any of the default templates packaged with the plugin. You will find them as .PHP files in the <code>wp-content\/plugins\/<wbr \/>molongui-authorship-pro\/views\/authors-list\/<\/code> folder.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Molongui Authorship Pro allows you easily display a list of all authors in your site. And you have different layouts to choose from. However, you might want to display the list in a very different way. If you find yourself in such need and you have PHP coding skills, keep reading because this article is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,45],"tags":[57,12,19],"class_list":["post-2348","post","type-post","status-publish","format-standard","hentry","category-authorship","category-howto","tag-authors-list","tag-howto","tag-shortcodes"],"_links":{"self":[{"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/posts\/2348","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/comments?post=2348"}],"version-history":[{"count":8,"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/posts\/2348\/revisions"}],"predecessor-version":[{"id":2369,"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/posts\/2348\/revisions\/2369"}],"wp:attachment":[{"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/media?parent=2348"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/categories?post=2348"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/tags?post=2348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}