How to ‘Hide’ sections of your blog to non login readers
How To: Restrict sections of your blog to non login readers.
Sometimes, there are portions of site that may not suitable for the random public.
Now, there’s a cool trick to hide part of your article but still can be seen by a member who is “logged-in”! Don’t be confused though; this trick does not hide the whole article but only portions that you want.
Changing the WordPress core files can be a real hassle, and really should be left alone to a expert user. So we should avoid that nightmare, and take advantage of function.php instead.
Functions.php is a useful thing from WordPress template file. This file can be used as a way to add
your own functions to WordPress themes just like a plugin to your theme. If you don’t find function.php in your theme folder, you can just create it from a blank file.
below is the script you can add to your function.php
After that, enter the following tag code [hide] to the section that you want to hide.
Examples like this: [hide] section or paragraph you want to hide [/ hide]
Anything inside [hide] and [/hide] will not visible to public, so you can safely hide any sensitive content from public.
What the reader that is ‘logged in’ will see…
And what a reader that is logged out will see…
And if you don’t want to hide a fraction of your content but rather the entire article or blog, WordPress has a nice and simple plugin for this!
http://wordpress.org/extend/plugins/force-user-login/
This plugin forces users to login before viewing any content. The installation is very easy and doesn’t need any detail configuration.
Incoming search terms for the article:
- wordpress hide content for public
- wp hide content for logged out users
- php code hide
- functions section of code
- login function php
- hide part of website registered users php
- html page hide sections for non registered users
- how to hide portions of site before registration of users
- hide wordpress login#
- hide twitter from non users