kaz Posted December 22, 2023 Share Posted December 22, 2023 I have need some scripts only in two pages. In one page I use an if query with the ID if ($page->id == 1042 ): Is a query able to use multiple IDs? 1042 | 1043 and 1042 && 1043 will not work Link to comment Share on other sites More sharing options...
Nicolas Posted December 22, 2023 Share Posted December 22, 2023 You can test multiple conditions in PHP if a if instruction as shown below if( $page->id == 1042 || $page->id == 1043 ) { // Do something here } 1 Link to comment Share on other sites More sharing options...
kaz Posted December 22, 2023 Author Share Posted December 22, 2023 @Nicolas great, it works perfectly! Link to comment Share on other sites More sharing options...
bernhard Posted December 22, 2023 Share Posted December 22, 2023 This would also work: <?php if($page->matches("id=1042|1043")) ... ? 4 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now