• Hello,

    in my functions file i have the below code, it shows the author name but i would like it to show Posted By (Author Name Here)…

    //
    // Author.
    //
    $author = sprintf( ‘rrr’,
    ( function_exists( ‘coauthors’ ) && is_singular(‘post’) ) ? coauthors_posts_links() : get_the_author()
    );

Viewing 2 replies - 1 through 2 (of 2 total)
  • what theme are you using?

    is that really some code from a working theme?
    that 'rrr' as format parameter does not make any sense; https://php.net/manual/en/function.sprintf.php

    try for example:

    // Author.
    //
    $author = sprintf( 'Posted by %s',
    ( function_exists( 'coauthors' ) && is_singular('post') ) ? coauthors_posts_links() : get_the_author()
    );
    Thread Starter nyckidd

    (@nyckidd)

    Thanks, sorry pasted some dummy stuff…

    I applied your hack but the posted by does not show..am using theme x from theme.co, i got this in the functions file for the child theme…

    if ( ! function_exists( 'x_integrity_entry_meta' ) ) :
      function x_integrity_entry_meta() {
    
        //
        // Author.
        //
        $author = sprintf( 'Posted by %s',
          ( function_exists( 'coauthors' ) && is_singular('post') ) ? coauthors_posts_links() : get_the_author()
        );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add "by" or "Posted by"’ is closed to new replies.