{"id":296,"date":"2020-08-18T10:11:07","date_gmt":"2020-08-18T08:11:07","guid":{"rendered":"https:\/\/www.molongui.com\/help\/how-to-change-social-icons-order\/"},"modified":"2022-02-21T18:27:30","modified_gmt":"2022-02-21T17:27:30","slug":"how-to-change-social-icons-order","status":"publish","type":"post","link":"https:\/\/www.molongui.com\/help\/how-to-change-social-icons-order\/","title":{"rendered":"How To Change Social Icons Order"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"296\" class=\"elementor elementor-296\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-091dd83 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"091dd83\" 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-c28fca0\" data-id=\"c28fca0\" 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-8b03ee0 elementor-widget elementor-widget-text-editor\" data-id=\"8b03ee0\" 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>In the author box, icons are displayed in alphabetical order, so a social network which name starts with an &#8220;A&#8221; gets its icon displayed before any other network. Facebook icon appears before Twitter&#8217;s, for instance.<\/p>\n<p>You might want to change that to give more importance to some networks listing them first. Whatever the reason, you can define the order in which to display the icons adding the following code to your <code>functions.php<\/code> file.<\/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<section class=\"elementor-section elementor-top-section elementor-element elementor-element-6141da4 elementor-section-stretched elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"6141da4\" data-element_type=\"section\" data-settings=\"{&quot;stretch_section&quot;:&quot;section-stretched&quot;,&quot;background_background&quot;:&quot;classic&quot;}\">\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-29a71ce\" data-id=\"29a71ce\" 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-e80251b elementor-widget elementor-widget-code-highlight\" data-id=\"e80251b\" 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> \/**\n  * Order social media icons.\n  *\n  * Molongui Authorship Plugin.\n  * https:\/\/wordpress.org\/plugins\/molongui-authorship\/\n  *\n  * @param array $nouse Empty array. No use.\n  * @param array $networks Unsorted array of current active networks.\n  * @return array Sorted array of active networks.\n  *\/\n  function order_authorship_social_icons( $nouse, $networks )\n  {\n    \/\/ Here you can handle $networks array to order it as you wish. \n    \/\/ Sort in alphabetical order: sort( $networks );\n    \/\/ or sort in reverse alphabetical order: rsort( $networks ); \n    \/\/ or randomize the order: shuffle( $networks );\n    \/\/ or provide a custom order indicating social network ids: $networks = array( 'youtube', 'amazon', 'facebook', 'twitter', 'instagram' );\n    \n    \/\/ And always return the array.\n    return $networks;\n    }\n    add_filter( 'authorship\/social_networks\/order', 'order_authorship_social_icons', 10, 2 );<\/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\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-e270f09 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"e270f09\" 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-6db481c3\" data-id=\"6db481c3\" 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-16773220 elementor-widget elementor-widget-text-editor\" data-id=\"16773220\" 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>If you want to indicate a given order, you need to provide an array of social network IDs. The ID for a social network is, usually, the lowercase version with spaces removed of its name. So for &#8220;Facebook&#8221;, the id is &#8220;facebook&#8221;. And for &#8220;Read the Docs&#8221; it is &#8220;readthedocs&#8221;. You can get to know the ID of each social network in <a href=\"\/docs\/molongui-authorship\/author-box\/social-networks\/(opens in a new tab)\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"this support article (opens in a new tab)\">this support article<\/a> that lists all available networks.<\/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>In the author box, icons are displayed in alphabetical order, so a social network which name starts with an &#8220;A&#8221; gets its icon displayed before any other network. Facebook icon appears before Twitter&#8217;s, for instance. You might want to change that to give more importance to some networks listing them first. Whatever the reason, you [&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,1],"tags":[12],"class_list":["post-296","post","type-post","status-publish","format-standard","hentry","category-authorship","category-doc","tag-howto"],"_links":{"self":[{"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/posts\/296","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=296"}],"version-history":[{"count":4,"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/posts\/296\/revisions"}],"predecessor-version":[{"id":1698,"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/posts\/296\/revisions\/1698"}],"wp:attachment":[{"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/media?parent=296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/categories?post=296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.molongui.com\/help\/wp-json\/wp\/v2\/tags?post=296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}