[Resolved] Random tags after posts and in archive pages

Home Forums Support [Resolved] Random tags after posts and in archive pages

Home Forums Support Random tags after posts and in archive pages

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #331765
    Maziar

    Hi,

    I have enabled the option to show tags at the end posts and in archive pages. I am also using a bit of code to limit the number of tags shown to only 5. The thing is that since tags are shown alphabetically I keep showing the same 5 over and over.

    Are there any ways of randomizing the order of tags shown at the end of the post and in archive pages?

    Thanks

    #331844
    Tom
    Lead Developer
    Lead Developer

    What’s the code you’re using to limit them?

    #331889
    Maziar
    add_filter('term_links-post_tag','limit_to_five_tags');
    function limit_to_five_tags($terms) {
    return array_slice($terms,0,5,true);
    }
    
    #332050
    Tom
    Lead Developer
    Lead Developer

    Hmm, looked into this a bit and I’m not sure it’s possible.

    You might find an answer by posting on https://wordpress.stackexchange.com/.

    #332086
    Maziar

    Ok thanks

    #332200
    Tom
    Lead Developer
    Lead Developer

    No problem!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.