Support » Theme: Blogsonry » How Do I Get My Post Tags to Alphabetize ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author mrwweb

    (@mrwweb)

    Some themes may include that as a “feature” but that is more plugin/custom-code territory. I wlll not be adding it to this theme for sure.

    That said, take a look at this thread on WordPress Stackexchnage. If you’re even a little familiar with WordPress theming and plugin development, you could take that filter and make it a plugin file for your site.

    Thank you for your response, Mark.

    I’ll check out that link you provided…

    A kind contributor on WordPress StackExchange suggested that I past this code into the functions.php file of my Theme Editor:

    add_filter( "term_links-post_tag", 'themeslug_sort_tags_alphabetically' );
    function themeslug_sort_tags_alphabetically( $tags ){
        natcasesort( $tags );
        return $tags;
    }

    So far, it seems to work well.

    Theme Author mrwweb

    (@mrwweb)

    Word of warning: Anything added to the functions.php file of a prebuilt theme will be lost when you update it! As I suggested above, I strongly recommend you just turn the snippet into a plugin like this: https://gist.github.com/mrwweb/188281c2f71e2f21088a

    Then just upload that to /wp-content/mu-plugins/ or ‘/wp-content/plugins/az-the-tags/` and it’ll run!

    Thank you Mark,

    I didn’t know how to create a plugin, so I had kept a file copy of the script on my desktop to re-enter whenever you updated this theme.

    BUT at your advice, I just removed that script from my editor and uploaded and enabled your plugin instead.

    Still works fine…Thank You!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How Do I Get My Post Tags to Alphabetize ?’ is closed to new replies.