As @birgie pointed out, add a conditional statement to check that the date has been set:
if ( isset( $item->date ) && strlen( $item->date ) > 0 ) { ... }
Related Posts:
- How can I get an XML export of my 1K+ posts WordPress instance?
- How can I export post data in xml format?
- How to limit the content coming from wordpress shortcodes?
- How to properly loop through these external URLs to get them into the sitemap using this hook
- How to make a XML/PHP file returning custom field data from page
- How to split links generated into an xml sitemap to avoid exceeding 30 sec maximum execution time?
- Display image from an external rss feed on wordpress without plugins
- WordPress ajax-action failing because of newline in response
- SOAP Request/Parsing XML From wp_send_json_success
- Add valid XHTML closing img tags to WordPress galleries
- Fetching review value using wpdb class
- Export post data with xml to other site using php soap
- WordPress create custom XML RSS feed template
- Import Instagram post as WordPress post
- How do I get data from my database into my Custom Export Field
- WordPress post insertion from PHP file
- Creating a WordPress addon for ContactForm7 submission (.XML file export)
- How can I export data without using any import/export plugin
- Dynamically Create Posts Via XML File
- Adapting a php array to WordPress
- how to iterate through xml data?
- XML WP_Query problem in PHP 8.0 and 8.1
- Read data from external source. XML vs REST API
- How do I make a redirect in PHP?
- How to add a .php file to WordPress
- When to use Exceptions vs Error Objects vs just plain false/null
- Woocommerce get selected shipping zone id for the current user
- Include files in functions.php
- Retrieve POST data from AJAX call
- Woocommerce -How to set product regular price default
- Display all meta for a post?
- How to include external page to wordpress page?
- Facebook Comment Count
- How to overwrite youtube embed?
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- How to resize image on client-side before upload?
- Filter the blog title displayed in the header
- Add to previous posts under post
- How to show order data by multiple ID?
- Print html when custom field has value inside while loop
- how to create and show sessions in word press?
- Foreach insert query the best way
- Mail not sent when I set HTML headers
- Categories Template Assistance
- Stop Duplicating Terms in a Foreach Loop
- Generating add_settings_section() calls dynamically
- Is this code malidcous
- How to trash multiple post/product programmatically
- Loading jQuery in the footer after removing jQuery migrate?
- How to generate page content from database the right way?
- Force SSL using FORCE_SSL_ADMIN
- Proper way to edit a post via phpMyAdmin without breaking the compare revisions tool
- Sending jsPDF documents to the server
- Unit Test in WordPress
- “before delete post” action fire when the post is updated?
- Register non hierarchical taxonomy and the show meta box in the post type
- Admin username and password
- dynamic php inside wordpress page
- Converting MYSQL to WordPress $WPDB
- WP_Query loop, does not display special characters in title correctly
- Sum custom field values of particular taxonomy
- WordPress excerpt not working
- Random Default Avatar Function
- Get Admin Email Address From External PHP page
- Custom Text in WooCommerce Order Processing Email Based on Products
- Redirect to another page after submission using wp_mail
- How do I get current page ID in WordPress customizer file?
- How to run a php file that uses wordpress functions from command line?
- Loop with slider (slider not loading)
- Displaying admin notices inside the block editor from rest_after_insert_{$this->post_type} hook
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- Error when adding excerpt to the content through functions.php
- wordpress media library new uploads don’t write to database
- Add data attribute to each li in menu
- Was told to change the .htacess file form .html to .php so this would work properly
- Fresh Install WP error – “The site is experiencing technical difficulties” [closed]
- How to bypass maintenance mode with external cron?
- Displaying Woocommerce Product Category in WordPress
- Woocommerce : Can’t get product info in loop
- Split reads to a different connection string
- custom user role wordpress – grant guest access to edit.php without insert/update/delete
- inserting a post from an extern php file but post content doesn’t show on wp site
- PHP > Scheduled Tasks > Sending daily email with dynamic API variables
- wordpress – page not loading (404) even if it’s there
- if is specific custom post in cpt
- Why is this specific API request failing when sending via wp_remote_post?
- Trying to add taxonomy terms to search results page
- I updated my version of php and got error
- undefined variable in php
- custom AJAX filtering logic and outputting results into an Elementor Loop Grid widget
- translating a custom taxonomy term in a shortcode
- how can I get the selected term of a custom taxonomy
- Getting checkboxes for some tags in a search box
- WordPress move current to top in the loop
- How to change product SKU’s in bulk with a plugin
- BrowserSync not detecting PHP files in WordPress + Laravel Mix
- Function for Post Creation plugin for Gravity Forms
- success Message not Displaying
- child category under correct parent
- PHP Warning: Undefined array key “HTTP_REFERER”