942,513 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 1547
  • PHP RSS
Jul 25th, 2010
0

PHP external link open new tab

Expand Post »
Hi,

I need help you php master to solve a problem with this code to open new window when someone click.

PHP Syntax (Toggle Plain Text)
  1. <!--RSS FEED-->
  2. <?php if(function_exists('fetch_feed')) {
  3.  
  4. include_once(ABSPATH.WPINC.'/feed.php');
  5. $feed = fetch_feed('http://feeds.com/');
  6.  
  7. $limit = $feed->get_item_quantity(20); // specify number of items
  8. $items = $feed->get_items(0, $limit); // create an array of items
  9.  
  10. }
  11. if ($limit == 0) echo '<div>XXXXXX</div>';
  12. else foreach ($items as $item) : ?>
  13.  
  14. <div>
  15. <a href="<?php echo $item->get_permalink(); ?>"
  16. title="<?php echo $item->get_date('j F Y @ g:i a'); ?>">
  17. <?php echo $item->get_title(); ?>
  18. </a>
  19. </div>
  20. <div>
  21. <?php echo substr($item->get_description(), 0, 0); ?>
  22. <span></span>
  23. </div>
  24.  
  25. <?php endforeach; ?>

Last edited by jens86; Jul 25th, 2010 at 8:36 am.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jens86 is offline Offline
16 posts
since Jul 2010
Jul 25th, 2010
0
Re: PHP external link open new tab
Sorry I have just let target blank like this below and works well

<!--RSS FEED-->
<?php if(function_exists('fetch_feed')) {

	include_once(ABSPATH.WPINC.'/feed.php');
	$feed = fetch_feed('http://feeds.com/');

	$limit = $feed->get_item_quantity(20); // specify number of items
	$items = $feed->get_items(0, $limit); // create an array of items

}
if ($limit == 0) echo '<div>Powered by SportPicks.WS</div>';
else foreach ($items as $item) : ?>

<div>
	<a href="<?php echo $item->get_permalink(); ?>
	  title="<?php echo $item->get_date('j F Y @ g:i a'); ?>" target="_blank">
		<?php echo $item->get_title(); ?>
	</a>
</div>
<div>
	<?php echo substr($item->get_description(), 0, 0); ?>
	<span></span>
</div>

<?php endforeach; ?>

SoLVED
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jens86 is offline Offline
16 posts
since Jul 2010

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Log files/Log table
Next Thread in PHP Forum Timeline: Regarding Google and API





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC