RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.20% (5.24%*) • Home Loan Fixed: 5.48% (6.24%*) • Fixed: 5.48% (6.24%*) • Variable: 5.20% (5.24%*) • Investment IO: 5.74% (6.40%*) • Investment PI: 5.49% (6.32%*)

Administrator Only Notes in WordPress

If you run a blog with multiple authors, it's often useful to post a specific message to the author of that post on the specific post page. It may include corrections they're required to make, corrections you've made, feedback or more dynamic elements. Usage is via the shortcode of [note]Message to be displayed in here[/note] inside the actual post content. Colors can obviously be customized.

Copy and paste the WordPress function into your theme's functions.php file or, if you sensibly have one installed, your custom functions plugin.

1
<?php 
2
/*
3
 Administrators Only Notes
4
 http://www.beliefmedia.com/code/wp-snippets/admin-dashboard-message
5
*/
6
 
7
function beliefmedia_admin_post_note($atts, $content = null) {
8
  global $authordata;
9
 
10
  $authorname = $authordata->display_name;
11
  if (current_user_can('publish_posts'))
12
 return '
13
<p style="padding: 5px 5px 5px 5px; color: #1e0e15; border: #dd4b39 2px solid; background: #f5f5f5"><strong>Admin Message for ' . $authorname . ': </strong>' . $content . '';
14
}
15
add_shortcode('note', 'beliefmedia_admin_post_note');

Download our 650-page guide on Finance Marketing. We'll show you exactly how we generate Billions in volume for our clients.

  E. Australia Standard Time [ UTC+10, Default ] [ CHECK TO CHANGE ]

  Want to have a chat?
 

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment