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 have started a new site (here), I want to add the theme a RSS icon/logo on the top right of the theme (like in this theme).

What is the best way for doing that? (PHP/CSS wise)

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

You want some code to be added to the #title element. You can do this, as Sorich said, by copying the header.php file and just adding it there, but you could also try to add it in the footer and then using Javascript move it to the correct element. This might survive theme upgrades better, but is maybe not so user-friendly (the image appears just after the page has been loaded, giving a strange flash).

The code you need is simple, let's take the example you gave:

<p>
    <a href="<?php echo bloginfo('rss2_url'); ?>">
        <img style="vertical-align:middle" src="http://www.r-bloggers.com/wp-content/themes/black-lucas/images/rss.png" alt="Subscribe to R-bloggers">
        RSS Feed
    </a>
</p>

Of course, you would copy the image to your own server and change the path. You can check the styles used on the page, using a good web inspector/debugging tool (like Firebug).

share|improve this answer
add comment

Generally:

  • Some themes provide hooks or widgets areas that you can use
  • For the theme which does not provide them, you can create a child theme or edit templates files.

With the theme you are using on your blog, there is no hook. So, I would recommend creating a Child Theme. The benefit is that your modifications will not be overwritten during a theme upgrade.

Steps:

  1. Create a child theme
  2. Copy header.php from the theme directory to the child theme
  3. Modify the new header.php file in the child theme directory

See the codex for details about the feeds URLs.

share|improve this answer
    
Thanks Sorich, But what (css/php) code do I use to add the logo in the correct place? –  Tal Galili Oct 9 '10 at 13:58
add comment

It depends. There is number of ways theme can be customized:

  • it can include ready-made widget areas or admin control panel;
  • it can include set of hooks to insert content in different areas;
  • templates can be directly edited;
  • etc.

Most basic way to modify header is header.php template, called by get_header() function.

But without seeing the internals the only person who can properly answer this is theme's developer.

share|improve this answer
add comment

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.