Support » Plugin: Co-Authors Plus » Co-author not showing with

  • Resolved kimi07

    (@kimi07)


    The shared link leads to an blogpost written by two people, but after publishing, the second author’s name didn’t show.

    This is the case for another article too. Would like the site to be able to show all authors at the top as they deserve the credit.

    Can someone please help.

    Thanks

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Niels Lange

    (@nielslange)

    Hello @kimi07,

    Have you added the template tags to your theme, as described on https://docs.wpvip.com/technical-references/plugins/incorporate-co-authors-plus-template-tags-into-your-theme/, to show the co-authors on your site?

    Thread Starter kimi07

    (@kimi07)

    Hi… thanks for your reply. Been desperately waiting for it.

    I tried following the instructions by adding the tags but not working .. maybe done it wrong. Any chance you can help me do this? I would like only the authors names to show.

    Thanks

    Plugin Support Niels Lange

    (@nielslange)

    Can you explain in detail what you have tried so far and what theme you are using?

    Thread Starter kimi07

    (@kimi07)

    1. I add the first snippet above the original but nothing worked.
    2. Then I deleted all and replaced it with the hybrid tags and that didn’t work either.
    3. The template I’m using is mh magazine but looking to change it down the year.
    Website is http://www.teakisi.com

    Thanks

    Plugin Support Niels Lange

    (@nielslange)

    I looked up this case and the theme is using two different functions to display the authors. On the homepage and/or the blog posts page, the function mh_magazine_lite_loop_meta is used, while on the single blog post pages the function mh_magazine_lite_post_meta is used.

    To display the authors on your site, you can add the following code snippet to your site:

    if ( ! function_exists( 'mh_magazine_lite_loop_meta' ) ) {
      function mh_magazine_lite_loop_meta() {
        echo '<span class="mh-meta-date updated"><i class="fa fa-clock-o"></i>' . get_the_date() . '</span>' . "\n";
        if ( function_exists( 'coauthors_posts_links' ) ) {
          if ( in_the_loop() ) {
            printf(
              '<span class="mh-meta-author author vcard"><i class="fa fa-user"></i>%s</span>' . "\n",
              coauthors_posts_links( null, null, null, null, false )
            );
          }
        } else {
          if ( in_the_loop() ) {
            printf(
              '<span class="mh-meta-author author vcard"><i class="fa fa-user"></i><a class="fn" href="%s">%s</a></span>' . "\n",
              esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
              esc_html( get_the_author() )
            );
          }
        }
        echo '<span class="mh-meta-comments"><i class="fa fa-comment-o"></i>';
        mh_magazine_lite_comment_count();
        echo '</span>' . "\n";
      }
    }
    
    if ( ! function_exists( 'mh_magazine_lite_post_meta' ) ) {
      function mh_magazine_lite_post_meta() {
        echo '<p class="mh-meta entry-meta">' . "\n";
        echo '<span class="entry-meta-date updated"><i class="fa fa-clock-o"></i><a href="' . esc_url( get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) ) . '">' . get_the_date() . '</a></span>' . "\n";
        if ( function_exists( 'coauthors_posts_links' ) ) {
          printf(
            '<span class="entry-meta-author author vcard"><i class="fa fa-user"></i>%s</span>' . "\n",
            coauthors_posts_links( null, null, null, null, false )
          );
        } else {
          printf(
            '<span class="entry-meta-author author vcard"><i class="fa fa-user"></i><a class="fn" href="%s">%s</a></span>' . "\n",
            esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
            esc_html( get_the_author() )
          );
        }
        echo '<span class="entry-meta-categories"><i class="fa fa-folder-open-o"></i>' . get_the_category_list( ', ', '' ) . '</span>' . "\n";
        echo '<span class="entry-meta-comments"><i class="fa fa-comment-o"></i><a class="mh-comment-scroll" href="' . esc_url( get_permalink() . '#mh-comments' ) . '">' . absint( get_comments_number() ) . '</a></span>' . "\n";
        echo '</p>' . "\n";
      }
    }

    Please note that I created this code snippet for the MH Magazine lite theme, thus, the open-source version of this theme. It should also work for the paid version of the theme. If not, then you’d have to contact their support team as we do not offer support for premium themes and plugins.

    Thread Starter kimi07

    (@kimi07)

    Ok thanks … should I add the above or delete what is there and then add yours?

    Thanks

    Thread Starter kimi07

    (@kimi07)

    Have tried adding the new tags and nothing changed: this was done with adding to existing one abs also removing the existing one and replacing with the one you’ve provided.

    However, I still feel that I’m perhaps not doing it right? I’m going via “authors page template”

    Thanks

    Plugin Support Niels Lange

    (@nielslange)

    Ok thanks … should I add the above or delete what is there and then add yours?

    You should replace your existing code with the code I posted above.

    Have tried adding the new tags and nothing changed: this was done with adding to existing one abs also removing the existing one and replacing with the one you’ve provided.

    However, I still feel that I’m perhaps not doing it right? I’m going via “authors page template”

    I’m not sure what you mean by adding the code to the “authors page template”. Do you have a template file called authors-page.php to which you added the code? What you could do is adding the code to your site using the Code Snippets plugin. If this also does not work, you might want to hire a developer via Upwork for this task.

    Thread Starter kimi07

    (@kimi07)

    Thanks for the feedback … I used the snippet to add the code then came back with error message on my site.

    I guess I have to try getting exert help as you suggested 🙁

    thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Co-author not showing with’ is closed to new replies.