Changing Excerpt Ending […] Text
-
I’m using the widget to display other blog posts on another WordPress website we’re currently running on this website (fortunately, this is a test website).
I wanted to change the […] text at the end of the excerpt to display
<a href"linktoarticle">Read More ></a>, going into the rss_multi_importer_widget.php file and changing the following if statement from:if ($showdesc==1 && $addmotion!=1){ $desc= esc_attr(strip_tags(@html_entity_decode($items["mydesc"], ENT_QUOTES, get_option('blog_charset')))); $desc = wp_html_excerpt( $desc, 360 ); if ( '[...]' == substr( $desc, -5 ) ) $desc = substr( $desc, 0, -5 ) . '[…]'; elseif ( '[…]' != substr( $desc, -10 ) ) $desc .= ' […]'; $desc = esc_html( $desc ); echo $desc.'<br/>'; }to this:
if ($showdesc==1 && $addmotion!=1){ $desc= esc_attr(strip_tags(@html_entity_decode($items["mydesc"], ENT_QUOTES, get_option('blog_charset')))); $desc = wp_html_excerpt( $desc, 360 ); if ( '[...]' == substr( $desc, -5 ) ) $desc = substr( $desc, 0, -5 ) . '<a '.$openWindow.' href='.$items["mylink"].'>Read More ></a>'; elseif ( '<a '.$openWindow.' href='.$items["mylink"].'>Read More ></a>' != substr( $desc, -10 ) ) $desc .= ' <a '.$openWindow.' href='.$items["mylink"].'>Read More ></a>'; $desc = esc_html( $desc ); echo $desc.'<br/>'; }As you can see from the test site, all it displays is the text itself. I wanted to know how I can make the
<a>elements to read like HTML and not pure text?Any help is appreciated!
-
Hi,
Just get rid of this line$desc = esc_html( $desc );
Hi Allen,
Oh goodness! How did I not see that?! Thank you so much! This worked for me.
great..so if the plugin works for you, please be sure to rate it..thanks
The topic ‘Changing Excerpt Ending […] Text’ is closed to new replies.