WordPress.org

Ready to get started?Download WordPress

Forums

show or hide part of page depending on admin set variable (2 posts)

  1. Leafblade
    Member
    Posted 4 years ago #

    I have an embedded radio player on my wordpress homepage, which i sometimes broadcast live music through. It is at the bottom of my front page at http://fira.at/ (its actually in an iframe, because its less buggy than php code in the middle of a page!)

    When I am not broadcasting, i want to be able to make the player dissapear from the page, and when i am broadcasting i want to be able to make it reappear. however, i dont want to have to edit the page each time just to acomplish this.

    what would be great is if there was a way to make it so when the content is hidden, non administrators just dont see anything on the page where the player would be. Administrators however would see a little show / hide option. when it is selected to "show", the player is visible to all users.

    the area to show or hide could be defined perhaps by simple tags in the page code. example

    <showhide>partof webpage which is variable</showhide>

    (on the page there would be admin only buttons to switch between modes)

    OR:

    even cooler would be if it could DETECT when the stream was active or not, and AUTOMATICALLY show or hide player. but i guess that would be greedy of me ;) heheh

    I realise this is a very specific question, and i hope somebody might have the time spare to ponder a solution for me :) I would be very grateful!

    Cheers in potential advanceness!

    :)

  2. esmi
    Theme Diva & Forum Moderator
    Posted 4 years ago #

    You'd need to set up some sort of custom option in your theme for this kind of functionality.

Topic Closed

This topic has been closed to new replies.

About this Topic