You can pass an array of IDs to is_page
instead of using multiple is_page
:
if( is_page( array( 11, 22, 33, 44 ) ) ) {
// Your code
}
Also, if you are using it in a loop, you should consider this note:
Due to certain global variables being overwritten during The Loop,
is_page() will not work. In order to call it after The Loop, you must
callwp_reset_query()
first.
Related Posts:
- class=”parent” for wp_list_pages?
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- Listing all sub-pages?
- syntax issue on php 7.4
- How do I publish only one page to production after making changes on staging?
- Can’t load WP function into external function
- Can’t get page content in WordPress
- Way to querry data (tags) from a wordpress database?
- Populate editor with some content of a page with a page template
- Create Page To Count Comments For Each Post In WordPress Site
- Inject class in body when particular page template is used
- Use .php file as page instead of wordpress page & template file?
- Use WordPress function in php file
- How to use theme function in post/page?
- Need php code’s output to display underneath a Divi Module
- PHP Output also in Child theme, but different
- How to Display a List of Child Pages For a Parent Page in WordPress
- A function to get the content of a page
- Getting page / post URL on publish and / or update
- How to return a Boolean for a page that is a subpage thru its name?
- List of all theme customizer control types?
- Modify previous and next text from pagination links
- PHP Script within wordpress theme
- if has theme mod
- Count Title and Post Characters
- Remove css styles from specific page
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- HTML table from shortcode with multiple parameters
- Add a Second Menu to a theme that only support 1 menu
- Custom excerpt function re-factoring
- Limit get_pages to only show 5 items
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Using Multiple Submit buttons to trigger customised php functions
- How to get specific image in media library with php
- Displaying the Month and Year that a page was Created?
- Only Show Link If div Exists
- Change the WP Video Shortcode Output
- How to pick the default selected value in wordpress dropdown?
- Using WP-API and SSE not authenticating user ID
- Validate functions before inserting then into functions.php
- How to retrieve current wordpress profile page URL?
- How to Reference/Echo Variable from Another PHP Function
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- How can I make an object available through the entire site?
- WordPress admin-ajax.php
- What exactly do this function declared into functions.php file of a WP theme?
- How do I modify the custom footer text and get theme version number to show in wordpress admin?
- How to use html inside a functions.php code?
- Nested “do” and “add” Actions is possible?
- Display Data in Table from External Database in WP using Shortcodes
- How to check if a Customizer setting is set?
- linking stylesheets and scripts with functions.php
- trouble with page_id & highlighting current page
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Remove item in Checkout
- How to get current post category details inside “loop”?
- Only load certain artists on this page
- Create special button on WP Tiny MCE Posts Editor for Shortcodes
- Toolbar Hidden in a Virtual Page
- Get the alt text of the image in a array
- Make table disappear when fields are left blank?
- Woocommerce order status payment
- How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes ‘&’ to ‘#038;’?
- Unzip file in functions.php, and add it to cron
- Add Block Before Entry Title Using PHP
- How to assign page id with array in page_scheduled_event
- Dynamically populate parameter in Gravity Forms using PHP
- Store ajax data in PHP variable
- comment_post (if comment is approved OR $comment_approved === 1) not working?
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- How can i create a function tag in my plugin
- How to escape echo for input tag?
- Including user data in “new user notification email”
- Display current user metadata on WordPress page
- Reload page with a different shortcode when a user selects from a dropdown
- Refresh page after login with litespeed cache
- Return newly created category by code
- Woocommerce Add custom “Add to cart button” in single page with tags
- Hook into all password resets in WordPress and get password before hashing?
- remove_action() not working in page template – Genesis
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- Dropdown menu on custom menu
- How can the searchform.php know if it’s used on a registered sidebar id ‘sidebar-1’ or ‘sidebar-2’?
- WordPress get_post_meta issue
- Woocommerce Price Text
- Modify php code to pass a page id as a parameter in order to create a breadcrumb
- Show custom default avatar instead of gravatar
- How to map my php files as the files for pages
- WordPress 2014 Theme – Featured Content with multiple tags?
- How to add feature image url in my template file and content as well?
- How to add button to top of theme customizer?
- ajax form function error
- Display custom meta box in my template file
- How to display the date under the post title?
- Simple Probléme in wordpress
- Contact form with dynamic dropdown and filter
- Critical Error customiser
- Automatically change insurance quantity based on cart total [closed]
- How to pass value to add_filter wpcf7_form_tag from another function?
- hiddenQuestions.find is not a function