How to add Random in Category Button

Community Forums Forums General Discussion How to add Random in Category Button

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  Tara123 2 months, 2 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #104618

    Tara123
    Participant
    Post count: 3

    Hi,

    I have some category pages where I show one page from a category on a page. Currently I have next and previous buttons but ideally I would like to have a button that gives a random post from that category.

    http://inspirationzoo.com/logo-design/

    As there will be a lot of different category pages if possible I would like not have to specifically specify a category in the code.

    Is this possible please.

    Thanks in advance for any help.

    http://inspirationzoo.com/logo-design
    #104628

    braddalton
    Participant
    Post count: 8873

    You would need to create a new WP_Query and add a link.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #104928

    Tara123
    Participant
    Post count: 3

    Thank you but I don’t know much php, can you advise how I could make the link random

    #105013

    braddalton
    Participant
    Post count: 8873

    The code would need to be written and tested. I don’t have code to do that at the moment.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #105090

    Tara123
    Participant
    Post count: 3

    Ok thanks anyway.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.