The syntax is wrong. Write the condition as:
if (is_single()) {
your code here
}
Related Posts:
- Custom SQL query to get List of posts with featured image url
- the_post_thumbnail() based on the Post ID
- Insert After Second Paragraph Without Tag?
- if post id matches these id’s then do this
- Get_the_author doesn’t return author name
- Link for Most Recent Post
- Using loop pagination on single.php
- single.php with different look by category
- Check If Post Was Published More Than 6 Months Ago Using get_the_date
- how to make an array of post id’s in is_single
- Pagination in single.php
- Limit the number of characters/words in an excerpt for a related posts section
- My single.php page skips the first div tag
- How to center all text body in single.php at once?
- LinkedIn Share Post Button
- Post Thumbnail on Single (if elseif else)
- Custom single.php files for different post formats
- Shortcode Displays 2 times
- Sending the reset password link programatically
- How to change upload directory in wp_handle_upload
- Only show div on homepage/blog index in wordpress/php
- Calculate percentage of post by category
- the_title() & the_content() are retrieving Post details inside a Page, after calling a shortcode
- register_rest_route regex option for base64 or alternate
- PHP syntax error when using wpdb update?
- Select dropdown not showing selected value php
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- Customized title tag for each page in pagination?
- Can is_page() be combined with a switch control structure?
- is it possible to force wordpress to always save thumbnails as ‘jpg’ not ‘png’
- Run a filter when a walker runs
- WordPress (3.9.1) MultiSite Permissions. Is chown the answer?
- have_posts() execution failure
- WordPress with php 5.5 and zend opcache
- Can’t search posts using WP_QUERY inside AJAX Function
- Woocommerce add to cart quantity buttons with AJAX
- Display fields as values in array from external SQL DB
- my posts are saved as drafts
- How can I remove a function that has been added to wordpress with add_filter?
- Create a range slider to change font-size with different screens sizes in wordpress customizer api
- Ajax load more posts with multiple tax query
- Are there security or other issues with changing PHP time limit and max input vars?
- How can I pass a custom/dynamic product to the Woocommerce cart?
- Adding Taxonomy Image to taxonomy loop [closed]
- Irregular TTFB and server wait time response
- How to get private property in parent class into extended class?
- WP_Query fails despite having 1 post
- Loop stopped working
- How does WordPress differentiate what scripts are loaded in wp_head() and wp_footer()?
- Download PDF after CF7 form submission
- 3 different times on my WordPress website
- Flexslider won’t work on WordPress
- Unable to Find Space in Custom Function
- Simple WordPress endpoint route doesn’t work
- Is it possible to create new user from external form using REST API?
- WP_Query: getting posts where custom field exists
- HTML dropdown setting not showing last saved value in the database
- Show the section only if custom taxonomy was chosen
- How to separate categories with commas?
- How can get all users by current user meta?
- Sort posts in a specific way
- How to hide post in WordPress
- Getting the slug into a variable, how to echo that variable
- The user can only see their own profile
- Hide a div when a custom field is empty
- Post meta select input, if statement
- Fatal Error wp-settings.php on line 119
- what does $options = get_option(‘test_theme’); do?
- Adding a custom meta field with default NULL value which is not selectable
- WordPress url By country code?
- How to change basename url for wp-admin?
- Prevent header and footer from loading on specific pages with template or plugin
- Get taxonomy terms that share a common object property
- WordPress all php BUT index.php downloads instead of loads
- Trouble matching strings (titles) using wp_query
- Current WordPress Page Title as Search Parameter into A Tag
- Yoast Breadcrumbs Inject Multiple Levels
- Maximum file Upload
- Unzip_file causing Media file upload error
- Primary navigation menu with timed items from custom post type
- Different Logo for Different Pages
- WooCommerce – Add Shipping class below each product in Shopping Cart page
- Escaping a Single Quote in str_replace for Nav Function
- Use fetch_feed(); Totally Outside of WordPress?
- widget: input the px value from user and use it as inline style in widget function
- Create a dynamic buddupress tab
- Problems with plugin that fetches data from database with ajax
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- When I use rewind_post() it shows menu items in my loop
- How to create categories out of a list of words?
- Is there a way of displaying related posts from lowest hyrachical order (lowest child category to parent category)
- Difference between php memory limit and wp memory limit?
- Dynamic Email Handler with ‘header (“Location: …’
- Grabbing value of input field inside of array
- Implement OAuth2 in custom plugin
- login redirect based on user role not work as expected
- redirect user from login page if is logged
- Count custom posts type and filter by tag
- Error with PHP 8
- How to create a User Role and give permission to only use Web Stories plugin?