WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on some themes for a multisite and would like to modify the code below. It relates to a special div that will display an image or logo that users upload.

Normally the logo links to the home page of the blog, but could it be modified so that if the user is logged in it will link to "/themes.php?page=wptuts-settings" instead which is the logo upload screen? Thanks

  <div class="art-headerobject"><div class="mylogo">
<?php $wptuts_options = get_option('theme_wptuts_options'); ?>   
        <?php if ( $wptuts_options['logo'] != '' ): ?>  
            <a href="<?php echo get_option('home'); ?>/"><div id="logo">  
                <img src="<?php echo $wptuts_options['logo']; ?>" />  
        <?php  endif; ?></div></a></div>
share|improve this question
up vote 0 down vote accepted

Change the line with the URL:

<a href="<?php echo get_option('home'); ?>/"><div id="logo"> 

… and check if the user is logged in:

<a href="<?php 
if ( is_user_logged_in() )
   echo admin_url( '/themes.php?page=wptuts-settings' );
    echo home_url( '/' );
?>/"><div id="logo"> 

And echo get_option('home'); is not correct.
See wp-includes/link-template.php:home_url() to understand why the real home URL is a little bit more complex.

share|improve this answer
Perfect - thank you very much for your help toscho – speedypancake Oct 27 '12 at 12:15

Your Answer


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.