Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm souping up a WP theme with the BuddyPress plugin to make a cool hybrid of sorts between the two. Anyway... I'm using the following to grab author RSS urls. The problem being the colon ":" is being stripped on the pages and I can't figure out why. Does anybody have a solution for this?

<a href="<?php echo "http://"; bloginfo('url'); ?>/author/<?php echo $curauth->display_name; ?>/feed/">My RSS Feed</a>

I have also tried simply adding http:// before the php grab of the URL, an it still strips it. I'm assuming this is a WP or BuddyPress problem.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

No idea why your colons are getting stripped out. Your original code, or @EAMann's answer, should both work unless you have some very strange filter going on.

But using built-in functions to get permalinks should make your life easier in general than trying to concatenate them yourself. Try this:

<a href="<?php echo get_author_posts_url( $curauth->ID ); ?>feed/">My RSS Feed</a>

... that is, assuming that $curauth is the user object as returned by one of the get_user*, get_author*, or get_currentuserinfo() functions.

share|improve this answer

A couple of things are wrong with your code. First of all, bloginfo() already echos ... so echo bloginfo() is redundant and won't work as expected. Also, you're not concatenating "http://" and bloginfo() because you're missing a . character between them.

The code you want to be using here is:

<a href="<?php echo get_bloginfo('url'); ?>/author/<?php echo $curauth->display_name; ?>/feed/">My RSS Feed</a>

This should create something along the lines of:

<a href="http://mysite.com/author/lucaswynne/feed/">My RSS Feed</a>
share|improve this answer
    
Thanks for the tip. I changed that part of the code. However, it still isn't adding the "http://" - the colon still gets stripped. –  AndrettiMilas Nov 27 '11 at 15:55
    
Can you show us more of your code? Is this running through an output buffer? Do you have any JavaScript running on the page that's parsing links? If you use this code as-is, it should be working ... so something's going on with your site that we can't see. –  EAMann Nov 27 '11 at 19:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.