Title: [Plugin: User Specific Content] Put code in template?
Last modified: August 20, 2016

---

# [Plugin: User Specific Content] Put code in template?

 *  Resolved [brianguerra](https://wordpress.org/support/users/brianguerra/)
 * (@brianguerra)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-user-specific-content-put-code-in-template/)
 * I want to put this in a template file for single posts.. Basically, I want the
   author of every post and the admin to have a little div box near the top with
   some pertinent information about the post. But I can’t find a way to dynamically
   set the user_name or user-id_ inside the loop so I don’t have to go in and paste
   code at the top of every post.
 * I’m currently echoing the shortcode, but perhaps there is a better way to do 
   this and I may just be using the wrong code to get get the author’s name?
 * <?php echo do_shortcode(‘[O_U user_ID=”<?php echo $curauth->ID; ?>,1″ blocked_message
   =””]
    <div class=”authorbox”>Stuff for author and admin here</div> [/O_U]’); ?
   >
 * It shows up for the admin user, but not the author.
 * [http://wordpress.org/extend/plugins/user-specific-content/](http://wordpress.org/extend/plugins/user-specific-content/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Bainternet](https://wordpress.org/support/users/bainternet/)
 * (@bainternet)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-user-specific-content-put-code-in-template/#post-2637856)
 * your code is wrong so the author’s id is never passed to the shortcode, try:
 *     ```
       <?php echo do_shortcode('[O_U user_ID="'.$curauth->ID.',1" blocked_message=""]
       <div class="authorbox">Stuff for author and admin here</div>
       [/O_U]'); ?>
       ```
   
 *  [Ross](https://wordpress.org/support/users/rlindsay/)
 * (@rlindsay)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-user-specific-content-put-code-in-template/#post-2637980)
 * Not to bump up an old post, but this is what I need. Looking for a way to globally
   deny unless set on a page-by-page basis. I’m putting your code, Bainternet, in
   my theme’s page.php before and after the content, but it’s erroring out (500)
   every time. Thoughts?
 *  [Ross](https://wordpress.org/support/users/rlindsay/)
 * (@rlindsay)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-user-specific-content-put-code-in-template/#post-2637981)
 * So I got the global deny working, but is there a way to set the individual permit
   to be the people on each page that I set in wp-admin like before? Right now that
   doesn’t work and it’s still blocked even if the person is selected on the page.
 *  Plugin Author [Bainternet](https://wordpress.org/support/users/bainternet/)
 * (@bainternet)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-user-specific-content-put-code-in-template/#post-2637982)
 * what?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: User Specific Content] Put code in template?’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/user-specific-content_ffffff.svg)
 * [User Specific Content](https://wordpress.org/plugins/user-specific-content/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-specific-content/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-specific-content/)
 * [Active Topics](https://wordpress.org/support/plugin/user-specific-content/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-specific-content/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-specific-content/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Bainternet](https://wordpress.org/support/users/bainternet/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-user-specific-content-put-code-in-template/#post-2637982)
 * Status: resolved