• hello.
    I have a sidebar text widget containing a line and a shortcode.
    This is to been seen on only two pages and only when the user is logged in.
    I am using this code in widget logic:
    is_page( array(‘profile’,’grocery-list’)) || !is_user_logged_in()
    which works great for the shortcode but it doesn’t work for the line.
    The line “My Favorite Recipes” is present on every page when not logged in. (https://www.lunchblocks.com/profile/)
    I’m probably missing some code here but I just don’t know what to add.

    Thanks!

    https://www.ads-software.com/plugins/widget-logic/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Try this:

    is_page( array('profile','grocery-list')) && is_user_logged_in()

    || = or, && = and, ! in front = not

    Thread Starter urbanheidi

    (@urbanheidi)

    Hi, thanks.
    I tried but now it doesn’t show anywhere logged in or not.

    Find more information here why is_page might not work as expected and how to make it work.

    Thread Starter urbanheidi

    (@urbanheidi)

    I looked at that page and tried to switch to a one of WP default themes, but the issue was still there. (I tried with the code I was uniting initially and the one you gave me.
    the other point, wp_reset_query(), seems a little too technical for me…
    Do you think that it is something I should do?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘not everything is hidden’ is closed to new replies.