instead of $currentdate = current_time('Ymd');
you can use $currentdate = new DateTime();
so the Final Solution should be as like given below
<?php
$currentdate = new DateTime();
$date = get_field('course_start_date', false, false);
$date = new DateTime($date);
if ($currentdate > $date) {
echo ' - Started.';
} else {
echo ' - Not started.';
}
?>
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
- get_transient(), PHP switch(), and comparison operators
- When is is_admin() available?
- Check if current page is wp-admin
- Second Navigation inside header
- 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
- Is there a WordPress version that is incompatible with PHP 5.3?
- WordPress, AJAX and pre_get_posts using conditional tags
- If tag equals then show else show
- 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
- Conditional string comparison failing for basename/slug
- “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
- 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]
- 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
- 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]
- 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()
- ACF number less than comparison not working
- How to find cause of PHP notices with no stack trace?
- How to paginate a list of custom taxonomy terms?
- reason of splitting theme files to multiple files
- wordpress separate registration for different roles
- Problem with Woocommerce REST API Authentication
- How to get custom image size for image uploaded in Customizer
- How to Fetch values from WP database based on selected option value by onchange using PHP?
- How to create a custom category of wordpress admin
- WordPress child theme fails to override parent navigation menu in /inc/structure/header.php
- Customizer: Output default value in Customizer CSS
- Converting HTML Template to WordPress Theme
- PHP Warning: chmod(): Operation not permitted in class-wp-filesystem-direct.php on line 173
- WordPress asks you for your FTP details if you want to run Automatic Updates/Upgrade Plugins
- Trying do build a contact form
- Building a REST API for your web app exposes primary keys of DB records?
- $_SESSION variables work perfectly on my local machine but returns NULL on development webserver
- Creating black and white copy of an image [closed]
- Add categorys to custom post type not working
- Limit the number of child pages
- WP_LINK_PAGES Generating Unnecessary Tag
- Why is home page content not displaying with this rewrite rule?
- How to show upcoming events according to start date field
- Some problems in custom widget
- Call a function in functions.php from within tags (JS)
- Displaying images outside the content
- WordPress Conditional / Multiple Taxonomy Query
- Show related products by attribute based and certain conditions
- How to retrieve taxonomy Metabox fields in frontend
- PHP function for horizontal Woocommerce thumbnails and badges
- How to count active users on a specific page
- WooCommerce display price before add to cart [closed]
- Create dashboard widget for custom theme support
- The style.php file inside theme-engine folder has other content on FTP
- How to override html codes in wordpress?
- Plugin Modification Change Functionality For Logged User Only
- How can I output the slug of a comment author?
- customizer live preview layout picker
- Modify category archive page loop on functions.php
- How to display html code on homepage
- two wordpress sites, two themes, one database, same content
- Check if values exists DB
- Trying to exclude posts from a category on the home page
- Php conditional help needed
- Adapting a php array to WordPress
- Different layout on search page depending on category post
- Dynamically pull the correct email address from a match
- Help with if/else loop [closed]
- How to modify default tags in wp_head()