I don’t think that is possible using some function (I can be completely wrong though).
What you can do is check page slug using if() statement.
Something like:
global $post;
$post_slug=$post->post_name;
if($post_slug=='harry-potter'){
//something here
}
Related Posts:
- Show content if parent page has children
- Current post’s author name in the author meta tag
- Conditional statement for parent, child and grandchild pages
- Trying to use Ternary operators with WP Conditionals
- When is is_admin() available?
- Check if current page is wp-admin
- Second Navigation inside header
- Browser title script ignoring is_page /else conditional [closed]
- Using is_page() in functions.php not working at all
- Output 2 items within the Loop
- conditional statement for custom taxonomy
- How to enqueue CSS and JS only on specific template?
- how could I load a different template part by page
- WordPress, AJAX and pre_get_posts using conditional tags
- WordPress from url get external source title
- If tag equals then show else show
- REQUIRED: get_bloginfo(‘template_url’) was found in the file search.php. Use get_template_directory_uri() instead
- Conditional statement for dates
- How can I display a div ONLY if it is not a certain term page
- Don’t show certain div on front page?
- If ‘editor’ is empty, then
- Add class to DIV depending on page loaded
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- Undefined index for default custom theme option
- Remove conditional tag from header
- Display an image based on field value
- Multidimensional Array
- “if parent category is” conditional?
- Conditional for Post Format
- conditional: if is page, and all subpages
- Woocommerce getting top level category parent and make all sub categories have the same template and menu
- page 1 is not paged
- How to add Text before my Custom Term and hide it when empty
- How can i create a function tag in my plugin
- Add code to the header of posts by particular author
- Display specific page if user signed in
- How to get Post sidebar & footer including html like get_the_content() which only gets content section?
- Widget Logic – display on page and all child
- Need to adjust condition to say if I’m pulling categories from a post, to pull only the first one
- Can’t put a hyperlink on Featured Post’s Image
- if user is admin display admin link and logout link else display logout only
- Rewriting to a different page based on existence of query string?
- Add code only for blog posts
- How to define Og Meta Tags in header using conditions [duplicate]
- If Month=Particular month display content [closed]
- How to echo a different field if another field is empty?
- Adding else if conditional statement to purchased theme
- Redirect users not logged in to the standard login page (and back) from some posts and pages
- Conditional in foreach loop is outputting content twice
- Advanced custom fields Repeater conditional statement not working [closed]
- Load slideshow.css file only if Slideshow is checked / on
- Issues trying to add a href statment with PHP into a PHP Echo Statement [closed]
- get_page_by_title() doesn’t return the post object if the title has inverted comma (‘)
- advanced custom fields: repeater field within conditional statement [closed]
- WordPress Block Editor Gutenberg running code inside ! is_admin()
- the_date() not working
- How to return number of found rows from SELECT query
- Extract the first oembed url inserted on the content of a post
- WP API V2 returning Invalid User ID
- How can update custom meta for all posts
- Sanitize get_query_var() url parameters
- PHP/MySQL issues when running WP on EC2 cloud [closed]
- How to safely remove the footer (twentytwenty)
- How do I fetch all comments per post via WP REST API?
- Using More Tag in Combination with the_excerpt
- combine Code 1 with Code 2
- Custom Form Processing Issue
- Custom theme: Alternatives to long list of ‘include’ in functions.php
- Reordering Buddy Press profile navigation [closed]
- How can I get the total number of installed importers?
- Change title only in dynamic page
- How to make products with no cost in WooCommerce
- Help with .htaccess and Login with Subfolders
- Catchable fatal error on 3.6 update
- AJAX – Returning Two JSON Objects with One PHP Function
- How can I access string value in an array?
- Defined WordPress Memory Limit to Unlimited
- How to use WordPress Conditional Tags in get_posts foreach loop
- Errors after upgrading PHP to 7.4 WordPress
- How to make jquery count down timer function manually editable
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- How to make a conditional statement within $output in shortcodes.php?
- Strip from or something better?
- Inline related post Gutemberg
- switch_to_blog() + do_action(‘generate_footer’) not working in multisite
- Woocommerce – if selected attribute term equals
- split 1 cart item into instock and back ordered
- Display page content in different sections – based on page break block?
- WP Error using wp_insert_term
- post_exists stops working in a scheduled event
- Add class to all meta boxes for a custom post type
- Override 404 when navigating to single php file
- I’m writing my first plugin and my echo output is showing up on every page of my wordpress installation
- Beyond widget side menu editing, with the php page, custom template
- wp_delete_comment is doing nothing
- conditionally load a default static image if image metabox has no value
- Let users register weight each day and save it in DB
- php 7.0 update to 7.1 and at least 7.2
- Differences and dis/advanages between: Fast-CGI, CGI, Mod-PHP, SuPHP, PHP-FPM
- Custom plugin doesn’t show in admin menu – when code added, displays an empty page