Use wp_list_pluck
to extract an array of IDs from your query, then pass those to is_page
.
$top_level_ids = wp_list_pluck( $top_level_pages, 'ID' );
if ( is_page( $top_level_ids ) ) {
// do something
}
Related Posts:
- Modify theme to get page excerpts on front page
- how to get specific page content
- Location-Based Pages displaying results near customer
- Page displays content from different query?
- How can I get the homepage from the loop?
- How to get an array of pages ID by some page’s slug and all its children pages in get_posts() function?
- Use get_posts() with ‘post’ and ‘page’ queries at the same time?
- How to set post slug when using wp_insert_post();?
- Check if is on child-page of a particular page
- Restrict admin access to certain pages for certain users
- Require title for pages
- Add a new page to wordpress programmatically
- How to embed page content in a blog post
- Notify admin when page is edited?
- How do I modify this page template to show subpage excerpts (not post excerpts)?
- List all pages and children in separate ul
- How do I load custom scripts and styles for a page?
- What are the options for running custom css and javascript files on a page?
- How to build a post and comment editing form in a page?
- Wrong Sub-Page Order
- WP won’t save changes in post (any)
- can i create 2 blog ‘feeds’ within one blog
- Password Protected Page Not Displaying Content After Entering Password
- Created pages not showing up in ‘All Pages’ list
- I made a custom page but WordPress seems to strip any HTML I put in this page
- How to exclude shortcode from specific page IDs if it’s set to global
- WASM page in WordPress website
- Include a specific page in your template
- Is it possible to have a landing page based on the visitors location?
- Play Video on Homepage Only
- Extra title output with this function wp_list_pages
- Remove number in URL
- Dynamically change page that loads
- Page title not showing up
- How to add Posts to a Page
- Proper way to implement/access a built-in page in my theme
- remove/hide pages from users backend
- Page not found error when adding text `2 = 2 ^ 1` to the page
- Related Links Page with moderated, user suggested link submissions
- If a page does not exist, include a different page?
- How to redirect a page to another?
- Adding Author and Updated Schema Markup to WordPress Static Pages
- Trying to Edit a Page but it sends me to a Product Edit page
- Get the ‘Content Permission’ roles as defined in a page
- Pages are hashed as of today
- Create a page that’s to not be indexed or accessible via slug
- Dynamic Landing Page
- Creating a dashboard menu page similar to the “Pages” page
- What is a subpage in WordPress?
- Get $post Object from another page
- How to edit a HTML list in WordPress?
- All Pages visible on the Frontpage
- Google Page Speed Insights not recognising WP-Cofig settings?
- Only Display a Featured Image on First Post Page
- Create page template with some static contents
- Can I schedule my site to launch at a set time and date?
- Changes in WordPress taking 48hrs to reflect [closed]
- Avoid pages losing template association on site re-deploy
- get_permalink not fetching correct pages
- redirect index.html inside folder to wordpress page of same name
- Show content if page is a grandchild of top level page
- Does Feedburner send notifications about WordPress pages?
- Ordering Pages and Increasing Navigation
- Static Website No Titles But Still Nav
- Search results to be only posts & children of page ID
- Embedding Password Protected (Private) “Blog Posts” BLOCK that shows Images and Excerpts on Password Protected Page (not the home page)
- On the list of Pages, clicking to Edit a particular page redirects to the list of trash
- How to hide a page in wordpress made for menu
- My pages are using my Index.php and not my page.php
- WordPress custom pages in a folder
- How to delete the scrollbar in my pages?
- Return true if parent page id matches
- Recovering a page from the drafts
- Not allow add New Page for role ‘editor’
- My Password Protected Pages Aren’t Working
- How to detect if some page template has been selected
- Why Google map can not show full size in a page?
- Page view displays not properly after update wordpress
- What’s the best way to manage sections on a page?
- Converting HTML to WordPress theme: integrating pages function and using its text editor, conditional enqueuing
- How do you assign custom template for Posts page (under Front page displays setting)
- Display custom_post_type with current taxonmy of a page
- Prevent page from displaying
- Adding CSS styles to Admin Area PAGES only (not POSTS or CPT)
- 1st Level Page with No Children
- Custom Filter using meta_value in wordpress admin list not working
- Loading custom jQuery and HTML in a WordPress page
- Add feed to a custom page
- Directory location of new page
- Grabbing the_content from “about us”
- Dynamic content in pages
- Page specific values in widgets
- Woocommerce – Making product pages child of shop
- Javascript will not run properly
- link a custom page into menu
- Show different number of posts on second page of category
- appearance of new page
- How to read a page’s “Shortcodes” from the Template File?
- How can a user login on a wordpress page?
- For some reason my posts are not showing up on my front page [closed]