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()
- How to make my scroll bar show under condition
- Side bar only if it’s not a single post or a specific page
- WooCommerce: Custom dropdown for variation selection
- How do I make an HTML table from a database table?
- dbDelta support for FOREIGN KEY
- Initialize WordPress environment to use in a real cron script
- “wp_enqueue_style();” don’t load new edited style
- Allowed memory size of 268435456 bytes exhausted (tried to allocate 64 bytes)?
- How to Add a Link to the Drop-Down User Menu in the Admin Bar?
- Remove username in emails or swap username for email
- List of posts by day of the week
- What SQL / WordPress queries would need a nonce?
- Creating bulk posts with Youtube videos
- add_image_size for header_image
- Return a numerical function value in Customizer controls
- Enable custom logo upload if logo is not in header
- theme_root returning a truncated URI
- Use .php file as page instead of wordpress page & template file?
- PHP include is only working in certain places in my custom WP theme
- Find hours between post_date and post_date_gmt
- Preg_Match(): compilation failed unknown property name
- Post images are not displayed on the front page
- Remove in post content
- JS file is not loading when i put wp_head() and wp_footer
- Using Custom Value Options in PHP
- Additional file upload in Gutenberg page options/featured image
- Add css class to string
- Replace custom SVG icons in Twenty Twenty-One
- Dropdown Category form. Only show Sub-Categories
- Display all categories including sub categories under a list ul
- WP Hook Before a post is created
- Efficient way of querying for a “fallback” post?
- Shortcode in a $output statement
- WP Redirect with user nickname/username
- Archive page if else not working for post_excerpt and post_content
- add bootstrap modal after login in wordpress
- syntax error unexpected ‘}’ at 364 line
- get_post_meta no longer working
- WordPress Plugin Receive a Link
- How to use plugins_url() inside PHP stylesheet file [duplicate]
- Using Excel formula in PHP. Use ^ symbol [closed]
- PHP warning Invalid argument supplied for foreach() on custom page template
- Assign new post author IF another user in custom field on post transition
- Create and publish a new post every Monday, listing the post titles and links to the posts published during the previous week
- Make a variable global and use it for inline script