How to leave only name a date on blog post

Hello all!

I need to know how to only leave my name and date on blog post. Right now it says “In Articles, Song Reviews by Aaron HunterAugust 19, 2018Leave a Comment”. I only want it to say the authors name and date it was posted. Anyone know how?

Hello There,

Thanks for writing in! Each of the stacks has its own post meta. I checked your account looking for your site associated with the license code. It seems that you are using Ethos. Because what you are trying to accomplish requires a template customization, we would highly to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released.

After the child theme is set up, please add the following code in your child theme’s functions.php file

// Custom Ethos Entry Meta
// =============================================================================

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

    //
    // Author.
    //

    $author = sprintf( ' %1$s %2$s</span>',
      __( 'by', '__x__' ),
      get_the_author()
    );


    //
    // 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%2$s</p>',
        $author,
        $date
      );
    }

  }
endif;

We would loved to know if this has work for you. Thank you.

Thank you for your response! I have a child them uploaded, but do I have to re upload the child theme once I find the file?

Hey There,

If you already have the child theme installed, please go to Appearance > Editor and find the “functions.php” file in the right side. Once it is loaded in the editor, you may insert the code. Just make sure you have copied and pasted correctly. Any incorrect character like a single quote, might result to a fatal error.

Please let us know how it goes.

Hey the code worked, but there’s no space between the author name and the date.

Hello There,

Just update this line:

<p class="p-meta">%1$s%2$s</p>

And an extra space using this one:

<p class="p-meta">%1$s %2$s</p>

Please let us know how it goes.

It worked perfectly. Thank you! I have another question, but I’ll post it on another tread. Thanks again!

You’re welcome!
Thanks for letting us know that it has worked for you.

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