WordPress.org

Forums

How to create an admin option that will 'show/hide' content (4 posts)

  1. Rainerbird
    Member
    Posted 4 years ago #

    Hi

    I hope someone can point me on the right track.

    Basically I have a custom homepage. I want to have an option in the theme, such as "show this section yes/no", and if it yes, then content will be shown (like a div etc), and if no, then it will be hidden.

    Any ideas?

  2. sahaskatta
    Member
    Posted 4 years ago #

    Just use jQuery, should be fairly easy, but if you are new to it, it will take a few hours to learn.

    Here's a simple tutorial I found from Google:
    http://www.learningjquery.com/2006/09/slicker-show-and-hide

    It may seem complicated at first, but you can honestly get it done by just adding about 20 lines of code.

  3. Rainerbird
    Member
    Posted 4 years ago #

    Sorry

    I want the option to be in the ADMIN. So that somewhere in the admin they can select an option, which will alter the appearance of content displayed on the front end.

  4. Pritam
    Member
    Posted 4 years ago #

    What you are looking for is a theme options page. Though there are some good articles on this, you will end up with errors on new WordPress as they are pretty old.

    I am about to post an updated article on creating theme options pages. You can check my technology blog for that article after a few hours. The post is about the exactly the same stuff that you are looking for.

    Hope to see you on my blog. And if you visit, don't forget to leave a comment and add the blog on your Facebook ;)

Topic Closed

This topic has been closed to new replies.

About this Topic