Jump to content

How I can nofollow rss out link ?


ali74

Recommended Posts

Hello

I use wordpress , I have a php code for show rss in my site

<?php 
include_once(ABSPATH . WPINC . '/rss.php'); 
$rss = fetch_rss('http://siteshoma.com/feed/'); 
$maxitems = 5; //Number for show 
$items = array_slice($rss->items, 0, $maxitems); 
?> 
<ul> 
<?php if (empty($items)) echo '<li>there is no content</li>'; 
else 
foreach ( $items as $item ) : ?> 
<li><a href='<?php echo $item['link']; ?>' 
title='<?php echo $item['title']; ?>'> 
<?php echo $item['title']; ?> 
</a></li> 
<?php endforeach; ?>

this above php code work fine in my site

I want 3 things in this above code

1- All of rss show be come after http://p30af.com/go.php?url= ( like http://p30af.com/go.php?url=http://google.com )

2 - all of link open in new tab ( target="_blank")

3 - nofollow all of rss link ( rel="nofollow")

how I can do this?

please add this things and give me new code

tanks for you best forum :)

Link to comment
https://forums.phpfreaks.com/topic/260074-how-i-can-nofollow-rss-out-link/
Share on other sites

<?php 
include_once(ABSPATH . WPINC . '/rss.php'); 
$rss = fetch_rss('http://siteshoma.com/feed/'); 
$maxitems = 5; //Number for show 
$items = array_slice($rss->items, 0, $maxitems); 
?> 
<ul> 
<?php if (empty($items)) echo '<li>there is no content</li>'; 
else 
foreach ( $items as $item ) : ?> 
<li><a target="_blank" rel="nofollow" title="<?php echo $item['title'];?>" href="<?php echo "http://p30af.com/go.php?url=".$item['link'];?>"><?php echo $item['title'];?></a></li>
<?php endforeach; ?>

 

forgot to add your title back in

If don't want go.php there, don't add it.

 

If remove go.php from the url it most certainly will not find the go.php script.

 

one thing you can do is make a folder called go, then inside make an index.php file, place the contents of go.php into there

 

and then use a link similar to this:

 

<li><a target="_blank" rel="nofollow" title="<?php echo $item['title'];?>" href="<?php echo "http://p30af.com/go/?url=".$item['link'];?>"><?php echo $item['title'];?></a></li>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.