Hello. I'm trying to upload a logo to my website. I have to replace <h1 id="logo"></h1> to <?php theme_logo(); ?>

The code is:

?>
<<?php echo $tag; ?> id="logo">>  <a href="<?php echo get_option('home'); ?>/"><img src="<?php bloginfo('template_url'); ?>/images/logo.jpg" alt="<?php bloginfo('description'); ?>" /></a></<?php echo $tag; ?>>

When I change it the code is:

?>
<<?php echo $tag; <?php theme_logo(); ?>   <a href="<?php echo get_option('home'); ?>/"><img src="<?php bloginfo('template_url'); ?>/images/logo.jpg" alt="<?php bloginfo('description'); ?>" /></a></<?php echo $tag; ?>>

After changing the code when I enter to my site it says there is a syntax error, unexpected <
Could you tell me please what is wrong with the changed script? Thank you

your code have a syntax error like it was reported.. :p

?>
<<?php echo $tag; <?php theme_logo(); ?>   <a href="<?php echo get_option('home'); ?>/"><img src="<?php bloginfo('template_url'); ?>/images/logo.jpg" alt="<?php bloginfo('description'); ?>" /></a></<?php echo $tag; ?>>

in line 2, you have :

<?php echo $tag; <?php theme_logo(); ?>

it is supposed to be something like:

<?php echo $tag; theme_logo(); ?>

so your final code should be something like:

?>
<<?php echo $tag; theme_logo(); ?>   <a href="<?php echo get_option('home'); ?>/"><img src="<?php bloginfo('template_url'); ?>/images/logo.jpg" alt="<?php bloginfo('description'); ?>" /></a></<?php echo $tag; ?>>

i think it is something like a wordpress theme or something right? anyways, the wrong thing is you have <?php and then <?php
try removing it and lets see if it will make a difference..

You were right. Thank you so much. I have another question though. It seems that my logo is very big. How can I change its size?

is very big. How can I change its size

you can simply adjust the size of the logo using html.. this is what i usually do..

you can use the width and height attributes in html. eg:

<img src="logo.jpg" width="250" height="200" />

and depending on the width and height of your logo.
in your case, i think it should look something like:

<<?php echo $tag; theme_logo(); ?>   <a href="<?php echo get_option('home'); ?>/"><img src="<?php bloginfo('template_url'); ?>/images/logo.jpg" alt="<?php bloginfo('description'); ?>" width="250" height="100" /></a></<?php echo $tag; ?>>

or do you mean the file size?(KBs/MBs)

and by the way, if my answers are solving your questions, please give me up votes. haha.. i need to increase my ranking in this site (i like being ranked high) :)

Thank you for your effort but I couldn't make it :( Anyway, you helped me a lot

alright cool.. but you should have tried more... you should always try harder to solve problems! :)

If you are indeed working with WordPress, as it seems, then you might be able to adjust the logo size from your admin panel, depending on how you uploaded the photo.
If you uploaded it to the WordPress Media Library, you can go there, find the image, and select Edit. There's an option there to change the image size.
If you uploaded through your theme's Options panel, then you may be able to adjust the size there.

Thank you for helping. The problem is solved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.