WordPress.org

Ready to get started?Download WordPress

Forums

How to edit the continue reading link in the RSS feed (2 posts)

  1. Tom
    Member
    Posted 1 year ago #

    Hi,

    I'm using the Twenty Eleven theme and have been unable to find a solution to my problem, so here I am.

    I have burnt my RSS feed to Feedburner and I'm using the following snippet in my functions.php file to re-direct the WP feed there:

    // Re-direct RSS feeds to Feedburner
    add_action('template_redirect', 'smb_rss_redirect');
    function smb_rss_redirect() {
    	if ( is_feed() && !preg_match('/feedburner|feedvalidator/i', $_SERVER['HTTP_USER_AGENT'])){
    		header('Location: http://feeds.feedburner.com/MYRSSFEED');
    		header('HTTP/1.1 302 Temporary Redirect');
    	}
    }

    I'm also running some custom code to output the last 5 RSS feed entries in a dashboard widget.
    I'll now explain what I'm having trouble with...

    On Feedburner, this is what's added to the end of the excerpt:
    http://s11.postimage.org/e3x0kx3dt/Feed_Burner.png

    Whereas on my custom dashboard widget, it's showing this:
    http://s14.postimage.org/otdxb14hb/dash_feed.png

    The links added on Feedburner, I don't mind since the links actually work. However on my dashboard widget, they're not linked.
    Ideally, I'd like to do away with those links all together. I don't mind if this means the links are also removed from Feedburner.. they're not that important anyway.

    What has me puzzled is the inconsistency!

    Does anyone know of a function that I could use to achieve this?

    Thanks

  2. Tom
    Member
    Posted 1 year ago #

    Here's my custom dashboard widget code, perhaps that will help:

    // Display an RSS news feed widget on the Dashboard
    function wp_admin_dashboard_add_news_feed_widget() {
        global $wp_meta_boxes;
        // The new widget
        wp_add_dashboard_widget( 'dashboard_new_feed', 'Latest from the WEBSITE NAME blog', 'dashboard_my_feed_output' );
    }
    add_action('wp_dashboard_setup', 'wp_admin_dashboard_add_news_feed_widget');
    function dashboard_my_feed_output() {
        echo '<style type="text/css">
    
    #smb-dashfeed {
    }
    
    #smb-dashfeed ul {
    	margin: 20px 40px 20px 40px;
    }
    
    #smb-dashfeed ul li {
    	background: url('.get_bloginfo('template_directory').'/smb-dashboard/images/smb-newsfeed.png) top left no-repeat;
    	padding-left: 65px;
    	min-height: 48px;
    	margin-bottom: 20px;
    }
    
    a.rsswidget {
    	font-size:16px;
    	float: left;
    	line-height: 24px;
    	margin-bottom: 10px;
    	vertical-align: middle;
    }
    
    span.rss-date {
    	font-size:12px!important;
    	float: right;
    	line-height: 24px;
    	margin-bottom: 10px;
    	vertical-align: middle;
    }
    
    .rssSummary {
    	margin-top: 10px;
    	clear: both;
    }
    </style>
    
    <div id="smb-dashfeed">';
        wp_widget_rss_output(array(
            'url' => 'http://feeds.feedburner.com/MYRSSFEED',
            'items' => 5,
            'show_summary' => 1,
            'show_author' => 0,
            'show_date' => 1
    ));
    echo "</div>";
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.