I am wanting to add this // Ondemand function to generate dynamic bit.ly urls function getBitlyUrl($url) { // fill up this 2 lines below with your login and api key $bitlylogin = 'mylogin'; $bitlyapikey= 'myapi '; // you dont need to change below this line $bitlyurl = file_get_contents("http://api.bit.ly/shorten?version=2.0.1&longUrl=".$url."&login=".$bitlylogin."&apiKey=".$bitlyapikey); $bitlycontent = json_decode($bitlyurl,true); $bitlyerror = $bitlycontent["errorCode"]; if ($bitlyerror == 0){ $bitlyurl = $bitlycontent["results"][$url]["shortUrl"]; } else $bitlyurl = $url; return $bitlyurl; } Code (markup): To my functions.php file which contains this - <?php require_once(TEMPLATEPATH . '/controlpanel.php'); if ( function_exists('register_sidebars') ) register_sidebars(2); register_sidebar(array('name'=>'Sidebar 3', 'before_widget' => '', 'after_widget' => '</li></ul></div>', 'before_title' => '<div class="sidebar3"><h2>', 'after_title' => '</h2><ul><li>', )); ?> PHP: But anywhere I add it, my admin panel messes up when I activate a plugin or empty my cache. Any help on exactly where in this file I should place this would help. Thanks!
Did you add it like this and it didn't work? What error showed? <?php require_once(TEMPLATEPATH . '/controlpanel.php'); if ( function_exists('register_sidebars') ) register_sidebars(2); register_sidebar(array('name'=>'Sidebar 3', 'before_widget' => '', 'after_widget' => '</li></ul></div>', 'before_title' => '<div class="sidebar3"><h2>', 'after_title' => '</h2><ul><li>', )); // Ondemand function to generate dynamic bit.ly urls function getBitlyUrl($url) { // fill up this 2 lines below with your login and api key $bitlylogin = 'mylogin'; $bitlyapikey= 'myapi '; // you dont need to change below this line $bitlyurl = file_get_contents("http://api.bit.ly/shorten?version=2.0.1&longUrl=".$url."&login=".$bitlylogin."&apiKey=".$bitlyapikey); $bitlycontent = json_decode($bitlyurl,true); $bitlyerror = $bitlycontent["errorCode"]; if ($bitlyerror == 0){ $bitlyurl = $bitlycontent["results"][$url]["shortUrl"]; } else $bitlyurl = $url; return $bitlyurl; } ?> Code (markup):