Okay
  Public Ticket #1486165
Author (Faculty) biographical info HTML
Closed

Comments

  •  1
    fallapart started the conversation

    On the author (faculty) page, the author biographical information has any HTML stripped out for display. Is there a way to have the HTML render to allow for more options for our staff?

    Attached files:  faculty-bio.jpg

  •  85
    Charles replied

    Hi There,

    This is a WordPress default, not a theme default/option. I recommend modifying this via functions.php in a child theme. There are several resources out there, but to get you started, check out - https://premium.wpmudev.org/blog/enable-or-disable-all-html-tags-in-wordpress-author-biography-profiles/

    And potentially: 

    https://wordpress.org/plugins/wp-html-author-bio-by-ahmad-awais/

    https://wordpress.org/plugins/html-in-author-bio/

    Kind Regards,

    Charles

  •  1
    fallapart replied

    Ok, thank-you. Is there anything particular to the Polytechnic theme that I should know about before creating a child theme?

  •  85
    Charles replied

    Using a child theme is standard across all themes. If you go the child theme route, I provide a starter child theme in the theme-download-package. For more information on getting all of the resources include in the theme-download-package, check out - Downloading, Extracting, and Included Resources

    And for child theme specific information, check out Child Themes & Template Customization: When Is It Right?

    Let me know if you have any questions.

  •  1
    fallapart replied

    Okay, I've tried these solutions (plugin and child theme) separately and in combination, and the HTML is still being deactivated on the faculty bio pages. Is this a function of author.php? Is there something other than the child theme functions.php page that would need editing in order to make this work?

  •  85
    Charles replied

    Hi There, 

    First, let me apologize for not catching this in my first analysis of the issue you were experiencing. You're correct, author.php plays a part in this and is the reason you're not seeing the expected results. 

    Themeforest began requiring Theme Authors to escape all variables being loaded via php for security reasons. So in this theme, in author.php on line 185, you'll see the description being escaped with this function: esc_html(). 

    Due to Themeforest requirements, there may not be a theme update that I can provide, but it's a pretty easy fix: 

    Add your child theme

    In functions.php add this line prior to the last } endif;

    remove_filter('pre_user_description', 'wp_filter_kses');

    Then add a copy of author.php from the theme, and remove the esc_html() wrap, so this:

    echo esc_html( $curauth--->description );

    becomes this:

    echo $curauth--->description;

    Let me know if that helps, and again apologies for the oversight. 

    Kind Regards,

    Charles

  •  1
    fallapart replied

    Worked great - thanks for your support on this!