to test if you are on specific page, you just need to test the identifier like that :
add_action("wp_head", function () {
$idPageToTest = 32867;
if ( isset($GLOBALS["post"])
&& ($GLOBALS["post"]->ID === $idPageToTest)
) {
echo "We are on page $idPageToTest.";
}
}
Related Posts:
- Pass PHP variable to javascript
- Creating a WordPress admin page without a menu for a plugin
- Create page when plugin is activated
- How can plugins have their own pages?
- Create a custom page template inside my wordpress plugin
- php page not found for plugin options menu
- Proper way to replace the_content only for pages created by custom plugin
- Pass PHP variable to javascript
- WordPress Frontend Page using Plugin
- Get content and send to 3rd party
- Choose default template for a page with code
- How to tell which Plugin is displaying?
- Redirect url in plugin to somewhere else?
- Meta box not displaying on the plugin page
- How to access the page without registering in wordpress
- is_plugin_active function doesn’t exist
- How can I find plugins’ slug?
- How to call a plugin function from index.php
- My custom made plugin has “a new version available” which links to unrelated plugin
- Where can I find a schema of wordpress plugin core architecture?
- How to remove duplicate sub-menu name for top level menu items in a plugin?
- WordPress Plugin Development from Scratch. How? [closed]
- How Does WordPress Uninclude/Deactivate A Plugin?
- How to fetch serialized data from wordpress options
- Passing URL parameters to WordPress pages and pretty url
- WordPress network: set themes and plugins for new blog
- How to get the custom page get_permalink?
- Plugin translations problem
- How can I add a custom meta value on file upload?
- Advanced Custom Fields into functions.php
- Admin-ajax.php is dying “0” without processing function
- How do I register a stylesheet inside a WordPress widget?
- WordPress register_activation_hook table creation not working
- Add a Custom Permalink option in the Permalink Admin Screen?
- How to remove an Ajax action
- nonces in custom oop plugin
- Has anyone used require.js for handling plugin scripts?
- Custom Text Under Navigation Links
- Set a category for a page
- publish_post plugin hook doesn’t always pass $post->post_content
- Multiple files in a plugin
- Wp die causing 500 Internal Server Error?
- adding a new value to a serialized array in WP_option table
- Write to / remove from default .htaccess file from plugin?
- What is the best way to mimic a search query within a plugin
- Remove rewrite rules generated by plugin during deactivation
- Programatically download a plugin
- Create dynamic page content from custom WordPress plugin page
- WordPress Gutenberg react make import of __experimentalUseInnerBlocksProps which is no more experimetal
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- Fixing WordPress’s Bug (failed to send buffer of zlib output compression) results in “White Screen of Death”
- Disable woocommerce cookies and delete cart data automatically
- How can I make my metabox appear?
- Consolidate plugin functionality into a theme
- qTranslate remove default directory from link
- Count posts by type including drafts and pending posts
- Redirect to another page using contact form 7? [closed]
- Display Custom Field Value on Admin Page Column
- Separate database for a wordpress plugin
- WordPress Multisite: Programmatically Activate / Deactivate a Plugin of a Specific Blog
- remove all submenus from plugin
- How to prevent plugins from sniffing/stealing other plugins’ options?
- Hook for page Request?
- composer not working on my plugin when i upload it to my website
- What is the WordPress approach to custom data?
- How to render a template file using shortcode inside a plugin
- How to rewrite URL and get the values?
- Does WordPress check for updates of a plugin via plugins root folder name?
- Delete data from custom table when deleting a post
- Disable plugin visibility at the plugin directory
- Need to add/remove group of options and display them as rows
- How to deactivate my plugin upon deactivation of NextGen
- Paypal Framework
- Widgets are not displaying in the admin panel
- How to overwrite the category template in a plugin
- Content-Security-Policy implementation with WordPress W3Total Cache plugin installed
- Fatal error “Call to undefined function is_plugin_active” each time the plugin is activated
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- How to make WooCommerce multiple filter with custom meta fields
- How to write different events from different functions in my file to a log file in WordPress
- Create a form and have custom menu display based on user answers?
- How to make a plugin api route have permission?
- Enabling plugin on specific pages and subpages
- Modify Plugin PHP Class in Child Theme – Correct Method
- Problem with conditional woocommerce custom checkout field
- Plugin to Delete All Posts Monthly
- mailjet plugin – extend functionnalities and reuse api
- Change wp_mail SMTP settings for each E-Mail
- WordPress Thumbnail add action if no thumbnail
- How can I add the custom taxonomy categories to the posts and pages?
- Creating fields in the database
- Pass strings to plugin function [closed]
- How to create a page template using custom plugin
- contact form 7 captcha support anyother captcha plugin? [closed]
- Create Custom Coupon Type
- How to provide page_template path in custom plugin using WordPress
- WordPress custom block: Link saved in database not retrieved when editing post
- Accessing Correct Database to Create REST API Endpoint
- Detect if user is on the specific page in WordPress
- A multi-section WordPress store [closed]