How can i change the logo on a site, dynamically, with a URL field which doesn't point to an actual image but to a rendering of an image. Is this possible? I've tried this:

$thisimage = $logo_img_url. "&file=" . $_SESSION[ 'logo_img' ] . "&width=300&height=80";
variable_set( 'logo', $thisimage );

but it's not working.

Any help would be appreciated. Thanks


This should echo the path to the theme logo, which you could wrap in an tag:

<?php echo theme_get_setting('logo_path'); ?>

If you want to re-size, crop, or modify the image you should do that in an image style. Once you have made an image style in Configuration > Media > Image Styles, you can echo the logo with that style like so:

<?php echo image_style_url('my_style_name', theme_get_setting('logo_path')); ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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