Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to change the url of the Wordpress 'Back to XXXX' on the wordpress url.

I've used this function to change the logo url, but there doesnt seem to be a footerurl reference.

add_filter( 'login_headerurl', 'custom_login_header_url' );
function custom_login_header_url($url) {
  return 'http://www.myurl.com/';
}

Any ideas how I can change this url with a filter? My wordpress installation is a micro-site sitting under a main site, which is why I want it to go to a different url that home_url.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Since this is not a standard feature you could achieve this with your own css and js you could add to the page like this

    <?php
    function custom_login() { 
    echo '<link rel="stylesheet" type="text/css" href="'.get_bloginfo('template_directory').'/custom-login/custom-login.css" />'; 
    echo '<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>'
    echo '<script type="text/javascript" src="'. get_bloginfo("template_url") . '/js/yourScript.js"></script>';
    }
    add_action('login_head', 'custom_login');
    ?>

change jquery url as wanted to get last version.

The div id where the link is in is called #backtoblog

you could change the innerhtml using javascript/jquery.

$('#backtoblog').html('<a href="http://gotomyblog.com">go back</a>');

or you could use css to get rid of it.

#backtoblog{display:none;}

like this.

enjoy

share|improve this answer
    
Hi, this sent me down the right path but there are a few problems with your answer. a) JS call is a CSS link b) No jQuery loaded (I load this aswell). –  SMacFadyen Aug 14 '12 at 14:08
    
yeah, my bad , copy paste nastyness. let me fix it. –  woony Aug 14 '12 at 14:21
    
Ok, I can accept it then. Cheers. –  SMacFadyen Aug 14 '12 at 14:24
    
should be better now, my bad for being messy. –  woony Aug 14 '12 at 14:32

I've amended the above answer by @woony to include jQuery and outputted my function differently.

function custom_login() { 
    ?>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
    <script src="<?php bloginfo('template_url'); ?>/js/custom-login.js"></script
<?php }
add_action('login_head', 'custom_login');

The custom-login.js

  $(function(){
        $('#backtoblog').html('<a href="http://xxx">&larr; Go back</a>');
  });
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.