Toggle, Hide and Display

How can I add some content to my page which is hidden when the page loads and displays when people click on a link?

Hide/Display also referred to as toggle or toggle switch is usually used to have some content on a page which shows only when people hit a link. The classical way to use it is:

What are the best sources for FAQ, Tutorials, Tips & Tricks about WordPress? (show)

either to display some text, photos and images, a bunch of links or whatever.

The code uses <div> (containers) to hide/display their content. You can set each div to display either right after the link as in the example above or you can set each of them to display in another part of the page or (as in the example below) have them all displaying in the same area.

Here I used it to embed various YouTube videos and have a menu on the left from which you can choose what video you would like to see

Of course it also works to display anything else.

Please note that I don't recommend using this method for search engines relevant content (content which you use to attract people to your site) since it's not clear whether they read the hidden content or not. So don't use it to build your entire website. However I see no reason why you shouldn't use this on content which is not so search engines relevant like YouTube videos you embed, just display some photos or text, ...

This is also used on my Music Popup page.

How this is done is described in my WPFAQ.org E-Book (sample)


This FAQ is also discussed in my WPFAQ.org E-Book (sample)


© WPFAQ.org - Tutorials, Tips & Tricks is made with WordPress and for WordPress.
It's an EBookStoretoday.com company. It’s presented by Cédric Giger and hosted by HostGator.com

Thank you for visiting and supporting my website,
- Cédric -




Now share it…

Share

Comments are closed.