Jump to content

Is it possible to have 2 has_parent= selectors?


joer80
 Share

Recommended Posts

My query would be:

has_parent=1019, has_parent=1056

Not using the |

Say the first one is a state, and the second is a city.  My code may build both depending on if the second says all in this state, or only one location. (Children of 1056)

If I need to, I can probably change it to clear out the first one, just wanted to know if having more than one is possible!

Thanks!

Link to comment
Share on other sites

Yes, you can use the selector that way (i.e. | will not work, but multiple declarations are fine)...although in your example, I don't see the need of the State since what you really want are the City's children? Meaning, you don't actually need has_parent but $variable->children() ?  :-)

Edited:

Clarifications

Edited by kongondo
Link to comment
Share on other sites

You are correct.  I am going to try to take it out soon but the code right now passes both!  It was a weird situation where the pages may or may not have a city as a parent.   :D

Thanks for the help!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...