Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Add second role to exclusion from members-loop.php?

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

  • shanebp
    Moderator

    @shanebp

    Try:
    `
    if ( ( $user->roles[0] != ‘subscriber’ ) && ( $user->roles[0] != ‘customer’ ) ) : ?>
    `


    modemlooper
    Moderator

    @modemlooper

    `if ( $user->roles[0] != ‘subscriber’ || $user-roles[0] != ‘customer’ ) `

    Try something like that


    modemlooper
    Moderator

    @modemlooper

    You need || not &&


    @satori83
    Participant

    @satori83

    I get a syntax error…
    Parse error: syntax error, unexpected ‘[‘ in /home/amerifit/public_html/wp-content/themes/DynamiX/members/members-loop.php on line 39


    @satori83
    Participant

    @satori83

    @shanebp
    That code did the trick! Thanks.

    @modemlooper
    Thanks for helping! The first code seemed to work, when I used || i got a error for some reason. Im a newb to php so I dont understand it too much..lol.


    modemlooper
    Moderator

    @modemlooper

    I didn’t wrap code in brackets correctly. :D typing on iPhone


    @satori83
    Participant

    @satori83

    @modemlooper
    Ok no problem. If it seems to be working though is there a reason I should change it to ||? As I said I don’t know what the difference is yet so if there is something I am missing I am all ears! :)


    modemlooper
    Moderator

    @modemlooper

    && means both statements must be true || means either one can be true. Even though both may work I like using || when evaluating either/or statements. If both were needed to be true then && is more appropriate.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] Add second role to exclusion from members-loop.php?’ is closed to new replies.
Skip to toolbar