Adjusting the post meta data

HI, I thought with your help I had this resolved. Trying to only have the “by Author Name” inthe post data. I asked support and they came back with this suggested code below for the function.php file. I added it but still get the word “In” before the “By Author Name” in my posts. I’m obvioulsy still a newby to this can you help further?

// 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()
);


//
// Output.
//

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

}
endif;

Hello Larry,

Thanks for writing in!

There is nothing wrong with this code. It is correct and valid for the Ethos stack.

// 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()
    );


    //
    // Output.
    //

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

After adding this code, if you have installed a caching plugin like W3 Total Cache, you must clear the plugin cache first before testing your site.

Please let us know how it goes.

Thanks. I recopied the code and replaced it in the function.php and seems to work fine now. Strange. Thanks so much for the help.

Glad we were able to help :slight_smile:

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