Syntax is wrong you need to phrase it like so:
condition ? TRUE : FALSE
so change your code to :
echo is_home() ? '1' : '0';
Related Posts:
- conditional statement for custom taxonomy
- Add class to DIV depending on page loaded
- Multidimensional Array
- If Month=Particular month display content [closed]
- Show content if parent page has children
- Current post’s author name in the author meta tag
- Conditional Statement – check if post has an attachment image
- Conditional statement for parent, child and grandchild pages
- When is is_admin() available?
- Check if current page is wp-admin
- How to do conditional publishing?
- Second Navigation inside header
- Using is_page() in functions.php not working at all
- Output 2 items within the Loop
- How to enqueue CSS and JS only on specific template?
- Add user settings to specific roles
- How to display conditional-content if wp_nav_menu( $args ) retruns something
- Create a new usermeta field for users
- Redirect to a different page through registration, depending on page
- how could I load a different template part by page
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- What is the correct way to write this conditional statement?
- Reordering Buddy Press profile navigation [closed]
- WordPress, AJAX and pre_get_posts using conditional tags
- Is_front_page inside header.php is always returning true
- If tag equals then show else show
- Advanced Custom Fields – display label and value only if value entered
- PHP conditional script issue
- How to check if the current page is at a specified path in the URL?
- 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
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- Can I set up a hover animation in CSS depending on a PHP conditional?
- Undefined index for default custom theme option
- Remove conditional tag from header
- Display an image based on field value
- Conditional featured image with youtube thumbnail
- How to make a conditional statement within $output in shortcodes.php?
- “if parent category is” conditional?
- Conditional for Post Format
- conditional: if is page, and all subpages
- Conditionally remove comments and post meta in functions.php
- Woocommerce getting top level category parent and make all sub categories have the same template and menu
- exclude custom post type from running a function
- page 1 is not paged
- include content within conditional statement?
- Show label for value only when value exists, basic php
- How to add Text before my Custom Term and hide it when empty
- Conditional formatting on data fetched from MYSQL
- How can i create a function tag in my plugin
- Find and print first entry from WordPress post in custom excerpt?
- Adding if statement
- Add code to the header of posts by particular author
- Display specific page if user signed in
- Change Login or Logout text based on status
- 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
- Jetpack: Display Site Title when no Site Logo
- If else statement based on referral URL
- if user is admin display admin link and logout link else display logout only
- Add code only for blog posts
- How to define Og Meta Tags in header using conditions [duplicate]
- Php conditional help needed
- How to echo a different field if another field is empty?
- Adding else if conditional statement to purchased theme
- Custom Meta Box If Else Statement
- Hide a nav menu item based on get_user_meta results
- Conditional in foreach loop is outputting content twice
- How do I reformat this to add php inside php?
- 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]
- Not able to see the error [closed]
- if is specific custom post in cpt
- advanced custom fields: repeater field within conditional statement [closed]
- WordPress Block Editor Gutenberg running code inside ! is_admin()
- How to add product in woocommerce with php code [closed]
- Show the most popular post per week
- Add a class to links in the visual editor (how to get old dialog back)
- Multiple do_shortcode($content) within one shortcode
- Index showing source code
- is_page(id) not working for blog page
- Why use the Settings API over a new administration menu?
- Only Show Link If div Exists
- A solution to set metatags with my page generating plugin?
- Maximum file upload limit in php.ini have no effect on wordpress
- How to get all first images of posts in same category?
- How to check if a Customizer setting is set?
- how to Update 15k products on plugin activation with meta_option
- Include custom fields in search
- Automatically delete posts one by one depending on published time
- Dropdown menu on custom menu
- Pagination in WP Queries
- Display product_brand with get_the_terms function
- echo vs output variable [closed]
- Critical Error customiser
- How do I do so that people can register on my wordpress site?