Private notes and members-only content – WortGepresst



STARTSEITE MULTIMEDIA WORTGEPRESST FAMILIENBANDE BOOKMARK PRIVACY


Private notes and members-only content

Private Notes

When working on posts and pages, drop yourself a private note that only you (and other admins) can see. All you need is the following code in your theme’sfunctions.phpfile:

PHP

 
This function sets up a shortcode that you can use in any post or page. Here is an example of how it works:

 
When displayed, private notes will be wrapped with the following markup:

 
Notice the includedprivate-noteclass, making easier to style. As with most everything else, this method is highly customizable. Explore the code, the Codex, and get jiggy with it.

Members Only Content

Another cool trick is displaying custom content for members and/or visitors only.
Display content only to visitors
To set up a shortcode that displays content only to visitors, add this to your theme’sfunctions.phpfile:

PHP

 
With that code in place, you can add custom for visitors with a simple shortcode in any post or page, like so:

 
Display content only to logged-in users
To set up a shortcode to display content only to logged-in users, add the following code to yourfunctions.phpfile:

PHP

 
With that code in place, you can add custom for members only with a simple shortcode in any post or page, like so:

 
Customization for these methods is encouraged

Font Resize
Contrast
Zur Werkzeugleiste springen