• I’m building a custom theme, so my sidebar is custom HTML/CSS design utilizing the sidebar.php file. Been searching for a way to do this using php random and such, and WP plugins, but so far no one’s talked about just showing a differently designed same sidebar on refresh, at least that I’ve seen.

    To be (I hope) clearer: theoretically, if I have sidebar1.php and sidebar2.php which have the same size and content, but the background colours are different so when you hit refresh on the page or a new page, one or the other will load randomly.

    Is there a way to call one or the other sidebars randomly? Or, can one side bar load a random set of HTML tags from within the same php file, or an external HTML file?

    It’s just a little design touch, not functionally different. Easy? Agonizingly complicated? Anyone?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Do you mean the widgets of your sidebar?

    Thread Starter shawncbarry

    (@shawncbarry)

    Hi Richard. I seem to be on a running streak of explaining myself badly. I’ll try to explain it another way:

    In my page template, there’s the php function get sidebar. Get sidebar, gets the sidebar. The entire sidebar is just divs and links, designed into the sidebar.php file. No widgets or anything. So, I’m trying to see if there’s a way for the get sidebar function to randomly call from 2 different sidebar php files on page refresh. The only difference is the way the sidebar background colours and text colours are styled, via css.

    Put another way, I’d like get sidebar to be able to randomly grab from 2 different sidebars. Make sense?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change sidebar design on refresh?…’ is closed to new replies.