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']; ?>" />
</div>
<?php endif; ?></div></a></div>
Change the line with the URL:
⦠and check if the user is logged in:
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.