date_post
-
Hi, actually in the header.php to show the post time there is a below code:
what i want is to print the post date/time which is coming from “Date Format” and “Time Format” from the wp General Settings
how i do change the function and these 2 steps?
Thanks
$date_post = ''; if ( array_key_exists( 'post_date', $the_post ) ) { $date = new DateTime( trim( $the_post['post_date'] ) ); $date_post = date_i18n( $format, $date->getTimestamp() ); }
$html .= '<span>' . __( 'Published', 'netsposts' ) . '</span><span>' . ' ' . $date_post . '' . '</span>' . ' ' . '<span>' . __( 'out', 'netsposts' ) . '</span>' . ' <span>' . NetsPostsHtmlHelper::create_link( $blog_url, $blog_name, $open_link_in_new_tab, 'netsposts-source-link' ) . '</span>
';
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘date_post’ is closed to new replies.