Jump to content

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>

 

If this isn't what want need to explain better.

 

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.