• Hi,
    With Hueman, the html on the frontpage (and category pages) seems to be filtered: No bold, italic, link (a href…) or shortcodes seems to work while they are ok when you look at the single version of the post.

    How to allow these html attributes and other shortcodes in the except of posts listed at homepage and category?

    Thanks a lot for help!
    Alain

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Mille. You might find this thread useful as it discusses basically the same topic.

    Thread Starter MilleSabords

    (@millesabords)

    Hi bdbrown,
    Thanks for your useful answer.
    In fact my need is to use the excerpt part of the content which is above the <–more–> link, not to add extra excerpt.
    Nevertheless the Rich Text Excerpts is interresting besause it allows me to add several html attributes if i copy the text in the except box.
    But I wanted to add Bootstrap style buttons, and they don’t appear on homepage until i modify the content.php in my hueman child theme with <?php the_content(); ?> instead of <?php the_excerpt(); ?>.
    So it meens Hueman is still filtering the excerpt, even if i use the Rich Text Excerpts plugin.

    How are you adding the buttons?

    Thread Starter MilleSabords

    (@millesabords)

    With this plugin:
    https://www.ads-software.com/plugins/bootstrap-shortcodes/

    it includes shortcodes like:
    [bs_button size=”md” type=”primary” value=”Commencer ici” href=”https://millesabords.net/blog/2013/05/12/jordanie/”%5D

    The default WP action is to strip shortcodes out of the automatically-generated excerpt. Try adding this to your child theme functions.php:

    /* activate shortcodes in post excerpt */
    add_filter( 'the_excerpt', 'do_shortcode' );
    
    /* if no manual excerpt, return the automatic excerpt without default trims */
    function my_wp_trim_excerpt( $text )
    {
    	if ( '' == $text ) {
    		$text = get_the_content('');
    	}
    	return $text;
    }
    remove_filter( 'get_the_excerpt', 'wp_trim_excerpt', 10 );
    add_filter( 'get_the_excerpt', 'my_wp_trim_excerpt', 99, 1 );
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to have Bold/Italic/link/Shotcodes in post except on homepage?’ is closed to new replies.