WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
[resolved] The combination of Conditional Tags (7 posts)

  1. bluebird2
    Member
    Posted 2 years ago #

    I try to make this work in widget logic:

    ! is_page('15') && !is_user_logged_in()

    But it seems widget logic does not understand that. The widget disappears as soon as I add:
    && !is_user_logged_in()

    It only works when I use one conditional tag. Any idea why this happens?

    http://wordpress.org/extend/plugins/widget-logic/

  2. alanft
    Member
    Plugin Author

    Posted 2 years ago #

    I think is_user_logged_in needs you to set Widget Logic to use "Load logic" setting of at least "after the theme loads", as that function is a 'pluggable' function that can be replaced by the theme. Give it a go

    http://wordpress.org/extend/plugins/widget-logic/installation/

  3. bluebird2
    Member
    Posted 2 years ago #

    Thanks.

  4. alanft
    Member
    Plugin Author

    Posted 2 years ago #

    That's going to go in the FAQ if it worked!

  5. bluebird2
    Member
    Posted 2 years ago #

    This is what I have in my widget now:
    is_user_logged_in() && is_page("15")
    I think when "is_page()" is first it does not work but when "is_user_logged_in()" comes first then it works.

  6. pikkabbu
    Member
    Posted 1 year ago #

    Thank you ! This has helped.

    I could have my widget show on all pages but one, just writing this in the widget field :

    is_page() && ! is_page(204)

  7. alanft
    Member
    Plugin Author

    Posted 1 year ago #

    what I did add to the FAQ was that there are issues with using is_page() that are detailed here

    http://codex.wordpress.org/Function_Reference/is_page#Cannot_Be_Used_Inside_The_Loop

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags