You could try to use the is_page() function – https://developer.wordpress.org/reference/functions/is_page/
The function signature accepts one parameter – $page
(int|string|int[]|string[]) (Optional) Page ID, title, slug, or array
of such to check against.
Default value: ”
if ( is_page('account') ){
// do some code here
}
Related Posts:
- Slugs as breadcrumbs for Pages
- Programmatically set page template based on page ID
- how to change link of some wordpress pages
- How to assign php file(template) to several pages with same prefix page name/slug
- How Can I Create a Friendly Slug for a Dynamic Page?
- Why isn’t is_page working when I put it in the functions.php file?
- Get the ID of the page a menu item links to?
- Define page template in wp_insert_post
- Add custom template page programmatically
- Define custom Page Template without its own .php file
- Disable visual editor on one specific page
- Filter the query ONLY for the search results page
- How can I programmatically create “child” pages on theme activation?
- How to display error messages using WP_Error class?
- which is the function that removes accented vowels?
- Check if has any sidebar active on current page
- Remove Page Title from Static Frontpage
- Target a certain page within wordpress backend (admin) i.e. Pages > About
- Breadcrumb how i can display page title with parent > child title with permalink ? any Idea
- Custom page template how to check is_page from functions.php?
- Calling a function from functions.php in custom page/ blog post
- Run Product Filter Javascript On Page Template
- Pages should have priority when using add_rewrite_rule
- Enqueuing Script in functions.php vs on the page
- How to make unique add_filter to the_content of specific page template files – so each template gets its own addition
- Get page slug and assign a variable within functions.php
- Adjust which tempalte a page uses with a function?
- Delete pages and Create default pages for all new network sites
- How to specify which Gutenberg blocks are available in the editor for a page template
- Make menu structure match page heirarchy on page parent change
- Filtering posts by category name based on page’s slug
- Change the slug of a particular page every x hours
- wp_insert_posts keeps adding multiple pages
- Sanitize slug title
- How to include local menu based on page id?
- Batch update menu_order attribute alphabetically
- How to enable template page only for a post id page
- Activate small php condition at footer over page template
- Identical custom taxonomy slugs for same hierarchical children
- Don’t delete a page if it holds users
- Get_template_part inside a folder
- List all-childpages on parent-page AND list child-pages on childpage itself but not the current one?
- Display post shortcode content in the sidebar?
- Why is my page feed returning empty content?
- Function only on a specific page
- Populate editor with some content of a page with a page template
- Functions For Calling Specific Elements
- Get page id or status by private pages?
- Inject class in body when particular page template is used
- Pass parameter to hooked function using custom page template
- different style sheet for just one page template
- What is the text that appears beside the page titles in the list of pages in the WP admin?
- Use /prefix/postname as a slug in post_name?
- Enqueue script on every page except one
- page-slug.php not working but only for specific slug
- Get term slug by term id and then explode it
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- How do I register a new settings page? [closed]
- Only echo Page Content (not page title & page content together)
- Page Template Won’t Load Correct CSS File
- get content from page through AJAX
- Function to check if custom page is used by page?
- Unable to use get_page_by_title() more than once per page?
- How to Override Page Template if URL matches query?
- Probleme shortcode with list author
- Enqueue script if not page template
- Remove the delete link from pages without a plugin
- Pagination won’t work on custom page
- Display list of pages that contain a certain string within the slug
- Change is_front_page() to is_page() to display ‘hero’ on entire site?
- Edit meta fields from within template
- Get child-pages slugs of current page into js-file
- Sending Messages Back to the Template After Processing?
- is_page_template wont allow me to enqueue scripts
- Define an extra field for all pages (with no plugin?)
- Custom field not updating via functions upon publishing
- How to use different jquery function of idangero swiper dependant on page template?
- Using array page name together with page id to deregister script
- How to add a class name to the ancestor of a post?
- How to add an excerpt and read more link to a page?
- My website is generating weired url parameters of paginated pages
- Logout redirect via page template without confirmation?
- Template Redirect Function Only Working When Logged In
- Woocommerce add to simple product attribute programmatically [closed]
- Check if a menu is empty?
- Function to Download External Images to My Site
- Do I really need the div class entry?
- Subpage template
- How to call a function on particular page like ‘contact-us’ from function.php of child theme
- How Can I Expand the WordPress Customize window without any Plugin?
- How to overwrite / extent wordpress function is_email
- WordPress upload_mimes not working for front-end uploads of 3D files
- Removing permalink from post thumb in twentyeleven
- Shortcode parse error – wrong syntax
- Run a jquery script on on a certain template page
- How to load jQuery in TOP of wp_footer?
- Getting out side of wp root folder from function.php using absolute path
- Strange error from functions.php files (wp_register_script)
- Enqueue JS + CSS via a child theme functions.php file?
- How to display milliseconds instead of seconds using timer_stop function? [closed]