• I’m currently looking for a way to display a button that changes color based on certain conditions. I’d like to create a network outage page that causes a RED button to appear under certain conditions. Otherwise the button is displayed as GREEN.

    Anyone come across anything like that for wordpress?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    It depends on what conditions any color is based on. For example, JavaScript can alter colors dynamically, but it’d need to have access to the conditions needed to justify a particular color. Similar for PHP, it needs access to the conditions in order to know what color to assign. The main difference is one is client side and the other server side.

    Either way, I suggest defining all desired colors using certain class selectors in your CSS. Then let JS or PHP assign the necessary class attribute to the button element based on conditions.

Viewing 1 replies (of 1 total)
  • The topic ‘Button / Link Conditions’ is closed to new replies.