PHP
  Home arrow PHP arrow Page 4 - Standards-compliant Link Targets with Wordpress
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

Standards-compliant Link Targets with Wordpress
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 4
    2007-12-19


    Table of Contents:
  • Standards-compliant Link Targets with Wordpress
  • Dynamically adding rel=’no follow’
  • JavaScript link targets
  • Putting it all together

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Standards-compliant Link Targets with Wordpress - Putting it all together
    ( Page 4 of 4 )

    The Wordpress plugin we created will work as soon as it is enabled in the Wordpress administration area.  The JavaScript, however, needs to be enabled.  In order to do this, we need to add a reference to it in our web site template.

    Either edit your site template manually or through the Wordpress admin area.  Open the header.php file associated with your current template, if there is one.  If not, apply this to the default header.php file found in the /plugins/default folder.

    <script type="text/javascript" src="outboundtarget.js"> </script>

    Add the line above anywhere between the <head> and </head> tags so that the external JavaScript is loaded with your pages.

    The src needs to be either relative to the current page or absolute to the JavaScript file you uploaded previously.  Be very careful when using relative URLs.  In Wordpress, this is not relative to the header.php file, it’s relative to the index.php file in your web root!

    With both scripts in place and the script reference added to your site template, you’re all set.  Everything should be working.  You can test it out by visiting your site and clicking any external link.  If it opens in a new window, everything went well.

    Using the code found in this article should help increase your page’s rank and search engine placement as well as allow pages with targeted links to validate under the new strict XHTML standards.



     
     
    >>> More PHP Articles          >>> More By Nilpo
     

       

    PHP ARTICLES

    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek