WordPress.org

Ready to get started?Download WordPress

Forums

Need html in widget excerpts (5 posts)

  1. rwilki
    Member
    Posted 5 months ago #

    I've read several suggestions but I'm still having trouble trying to stop html tags from being stripped in my widget excerpts.

    Doesn't seem to matter whether it's manual or automatic excerpts. Any ideas?

  2. alchymyth
    The Sweeper & Moderator
    Posted 5 months ago #

    what widget are you using to show the excerpts?

  3. rwilki
    Member
    Posted 5 months ago #

    It's called "business page services widget" from the attitude theme. I've put in a forum request on the support for that theme but haven't heard anything back.

    I see strip tag code for the title and byline but not for the text, so I don't know why it's stripping tags there. It does have code for stripslash but I wouldn't think that would remove html code.

    Thanks,
    Bob

  4. rwilki
    Member
    Posted 5 months ago #

    This is probably the filter that is stripping the html. Any idea how to remove the filter or alter it to allow certain html?

    if ( current_user_can('unfiltered_html') )
    			$instance['text'] =  $new_instance['text'];
    		else
    			$instance['text'] = stripslashes( wp_filter_post_kses( addslashes($new_instance['text']) ) ); // wp_filter_post_kses() expects slashed
    		$instance['filter'] = isset($new_instance['filter']);
    
    		return $instance;
    	}
  5. rwilki
    Member
    Posted 5 months ago #

    I removed "wp_filter_post_kses" in the statement and it seems to work fine with manual excerpt. It would be great if it could work with the automatic excerpt but I think I can live with this.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.