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
Post a Comment