WordPress.org

Ready to get started?Download WordPress

Forums

WP RSS Multi Importer
[resolved] Changing Excerpt Ending [...] Text (4 posts)

  1. abriel_s
    Member
    Posted 1 year ago #

    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!

    http://wordpress.org/extend/plugins/wp-rss-multi-importer/

  2. Allen
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,
    Just get rid of this line

    $desc = esc_html( $desc );

  3. abriel_s
    Member
    Posted 1 year ago #

    Hi Allen,

    Oh goodness! How did I not see that?! Thank you so much! This worked for me.

  4. Allen
    Member
    Plugin Author

    Posted 1 year ago #

    great..so if the plugin works for you, please be sure to rate it..thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic