php - WordPress shortcode function gives white page -


i'm creating shortcode own wordpress theme. created this:

function link($atts, $content = null) {     extract(shortcode_atts(array(         "to" => 'http://net.tutsplus.com'     ), $atts));     return '<a href="'.$to.'">'.$content.'</a>'; }  add_shortcode("link", "link"); 

but when add functions.php between opening , closing php-tags, gives me white page when enter whatever wordpress page. wp-admin , normal pages white.

i added on top of functions.php , @ bottom. neither worked. can explain why this?

please use code...

function mylink($atts, $content = null) {       extract(shortcode_atts(array("to" => 'http://net.tutsplus.com' ), $atts));      return '<a href="'.$to.'">'.$content.'</a>'; }  add_shortcode("mylink", "mylink"); 

link default keyword can not use link.

i hope get.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -