• Resolved bwo2024

    (@bwo2024)


    Hello, I am wondering if can we display both the Profile Image and social media icons on the author archive page?

    Current, on the author archive page (the Full Biography page), there are no Profile Image and social media icons showing up.

    Is there any fix to this?
    Thank you!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Molongui

    (@molongui)

    Hi @bwo2024,

    Yes, you can make the author box to be displayed on your author pages too. Please check out this support article on how to do that:

    https://www.molongui.com/help/how-to-display-the-author-box-on-author-archive-pages/

    If you have any questions, please let us know and we’ll be happy to assist you.

    Thread Starter bwo2024

    (@bwo2024)

    Thanks for your reply!
    Can we use the Code Snippets to add the php code instead of adding it to the template file?

    Thank you!

    Plugin Author Molongui

    (@molongui)

    You can do this if your theme includes an action hook that runs at the top of the author page. Some themes provide such hooks in their templates, but not all do.

    Let’s say your theme is GeneratePress, a great theme that provides many hooks that allow you to customize almost anything. You don’t need a third party plugin like Code Snippets to add custom PHP code to your site, our plugin already allows you to do that. Just go to: Authors > Settings > Advanced and find the Custom PHP panel. There, paste the snippet below:

    // Remove default author information displayed at the top of the author page.
    remove_action('generate_archive_title', 'generate_archive_title');

    // Add Molongui Authorship author box to the top of the author page.
    add_action('generate_before_main_content', function(){ echo do_shortcode('[molongui_author_box]'); });

    Save settings and check your frontend. The author box should have replaced default author data, showing author bio, social links and profile picture.

    For any other theme that provides a similar hook, the process will be the same:

    1. Optionally, prevent default author data to be displayed.
    2. Display the author box using the shortcode.

    Please let us know if this helps.

    Thread Starter bwo2024

    (@bwo2024)

    Thanks for your reply!

    I first tried to add the said PHP code to the following link: Authors > Settings > Advanced and find the Custom PHP panel. But it won’t work on the frontend.

    And yes, I am using GeneratePress. Can you kindly give me the steps in creating such a hook? Under Elements, I click Add New Element > choose Hook > Create, then at this point, I don’t know what do to next.

    Thanks!

    Plugin Author Molongui

    (@molongui)

    Please try adding this modified version of the provided snippet:

    // Remove default author information displayed at the top of the author page.
    remove_action('generate_archive_title', 'generate_archive_title');

    // Add Molongui Authorship author box to the top of the author page.
    add_action('generate_before_main_content', function(){ print_r(do_shortcode('[molongui_author_box]')); });

    Remember, go to: Authors > Settings > Advanced, find the Custom PHP panel, paste the snippet above and Save Settings.

    Important: Assuming you will copy the snippet from this post, make sure to paste it without formatting.

    That should do it. Please let us know.

    Thread Starter bwo2024

    (@bwo2024)

    Thanks, it works!
    But on my side, this creates another issue – for any page, it will create an author box on the top; and for any specific post (full text), it will appear two author boxes on the page – a new one on the top and the old one on the original place.

    Plugin Author Molongui

    (@molongui)

    Oh, sorry about that! We missed that the generate_before_main_content hook is running on every page. Please replace the provided snippet with this one:

    // Remove default author information displayed at the top of the author page.
    remove_action('generate_archive_title', 'generate_archive_title');

    // Add Molongui Authorship author box to the top of the author page.
    add_action('generate_before_main_content', function(){ if ( is_author() ) { print_r(do_shortcode('[molongui_author_box]')); } } );
    Thread Starter bwo2024

    (@bwo2024)

    Yes, this time it works just fine, thanks!

    Only one minor thing – now on the author page (example.com/author/johndoe), the author box with a short bio will run on the top, but below it, it will also show the name of that author (John Doe), even I now leave the Biography field (full bio) empty.

    It is a minor issue though.

    Plugin Author Molongui

    (@molongui)

    OK, let’s try this updated version. Replace the snippet provided earlier with this one below. Now you should get the author box displayed at the top of your author pages and your theme’s default author info removed:

    // Remove default author information displayed at the top of the author page.
    add_action( 'wp', function(){ if ( is_author() ) { remove_action('generate_archive_title', 'generate_archive_title'); } } );

    // Add Molongui Authorship author box to the top of the author page.
    add_action('generate_before_main_content', function(){ if ( is_author() ) { print_r(do_shortcode('[molongui_author_box]')); } } );

    Please let us know.

    Thread Starter bwo2024

    (@bwo2024)

    Great, it works, just what I need!
    It is very helpful of you, many thanks!

    Plugin Author Molongui

    (@molongui)

    Great! I’m thrilled to hear that everything is working as you needed! ?? Your feedback means a lot to us.

    If you have any more questions or need further assistance, feel free to reach out. We’re here to help!

    Thanks again for your kind words and for choosing our plugin.

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.