In posts leaving only date

Hello,

I have a very fast question. I have a similar thing as here - How to leave only name a date on blog post. But I would like to show only the date.

Shall I in this case use this code: ```
// Custom Ethos Entry Meta
// =============================================================================

if ( ! function_exists( 'x_ethos_entry_meta' ) ) :
  function x_ethos_entry_meta() {


    //
    // Date.
    //

    $date = sprintf( '<span><time class="entry-date" datetime="%1$s">%2$s</time></span>',
      esc_attr( get_the_date( 'c' ) ),
      esc_html( get_the_date() )
    );



    //
    // Output.
    //

    if ( x_does_not_need_entry_meta() ) {
      return;
    } else {
      printf( '<p class="p-meta">%1$s</p>',
        $date
      );
    }

  }
endif;

Please let me know.

Best regards,
Damira Teppo

Hi Damira

Thanks for reaching out.
You can use the code but it has highly suggested that you use a child theme. This allows you to make code changes that won’t be overwritten when a theme update is released.
Please remember that the code is a sample one and it varies case to case, and we can’t guarantee it works for you.

Thanks

Hello,

thank you for your answer. Yes, I am using the child-theme (it is installed and activated).

The code I tested from the original topic I mentioned and it worked for me, but it was showing still the author name. and what I asked in my last message is that I modified the code like this that only the date will be visible. So, the code is not like the original one. Just modified it based on the example with 2 outcomes to 1 outcome.

Will try it with one it will work how I need it.

Best regards,
Damira Teppo

Hi Damira,

We’re glad that the code is working on your end. Please bear in mind that we don’t support that code even though it is coming from our forum and it will fall under customization. Regretfully, customization is outside the scope of our theme support. You may seek 3rd party developers to help you with your problems or you can avail One where we can answer questions outside of the features of our theme.

Hope that helps.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.