How to Add Private Notes to WordPress Blog Posts

Add Tool

Add Private Notes to WordPress Blog Posts


Add Private Notes to WordPress Blog Posts

If you would like to add reference notes to your posts that will only be visible to authors of your blog, simply add this function to your theme’s functions.php file which will create a shortcode [note] so that you can add notes for authors by including them in [note] and [/note] while writing the post.

add_shortcode( 'note', 'sc_note' );

function sc_note( $atts, $content = null ) {
	 if ( current_user_can( 'publish_posts' ) )
		return '<div class="note">'.$content.'</div>';
	return '';
}

Now create a post using WordPress post editor and add your custom note using [note]...[/note] shortcode like the below code

[note]
This is a personal note that only admins can see!
[/note]

If you want to add different style of your created note write css using .note {} class


Source


Tags: Add Private Notes to WordPress Blog Posts, WordPress post editor, shortcode, function, wordpress shortcode, wp hack, private note, post editor, create shortcode, functions.php, wp snippets
Payza

About Masum Billah

Add Private Notes to WordPress Blog Posts 1stWebSuite website seo tool is a free website ranking tool site provides a lot of on page and off page seo useful tools for you. On this site, we have a large number of website ranking tools


SIGN UP TO GET UPDATE TO YOUR INBOX




Discuss about: How to Add Private Notes to WordPress Blog Posts


adf.ly