• Resolved geofeedz

    (@geofeedz)


    I am building a membership site that requires the comment template to only be visible to the author of the post and users with editor privileges.
    I am finding it hard to check if it is the author of the post, I have been at this for hours and cannot find anything in the codex or on google.

    This is what I have so far

    <?php if (is_user_logged_in() && current_user_can('level3' || 'manage_options') ) {   ?>
       <?php comments_template(); ?>
    
    <?php } else { ?>
        working
    <?php } ?>

    maybe I am writhing it wrong, but my brain is fried right now.
    I know manage_options is wrong, but I cannot find the right code.
    Any help is welcome. Thank you in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • <?php
    global $current_user;
    get_currentuserinfo();
    if (is_user_logged_in() && (current_user_can('edit_others_posts') || $current_user->ID == $post->post_author) ) {
    echo 'user is logged in and can either edit other posts or is the author of the current post';
    }
    ?>
    Thread Starter geofeedz

    (@geofeedz)

    Thank you. This was driving me crazy. Resolved

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Check if is author’ is closed to new replies.