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

  • Resolved brianguerra


    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Bainternet


    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]'); ?>

    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?

    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



Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: User Specific Content] Put code in template?’ is closed to new replies.