Forum Moderators: open

Message Too Old, No Replies

Logo to Point to Category permalink on Wordpress

         

anand84

3:14 pm on Jan 18, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a requirement for my wordpress blog. The logo at the header on each of single page(single.php) blog posts should point to the respective category permalink instead of the default homepage. Any idea how I can achieve this?

Thanks

Marcia

3:43 pm on Jan 18, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Custom category templates and conditional tags would probably do it. Links to those topics in the WordPress codex are in this thread:

[webmasterworld.com...]

anand84

5:25 pm on Jan 18, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Marcia

That was quite overwhelming. Anyway, I am trying to do something of my own.

I have replaced the original logo link which was


<a href="<?php bloginfo('url') ?>"><img src="<?php bloginfo('template_url') ?>/images/logo.jpg" /></a>

with


<a href="<?php single_cat_title(); ?>"><img src="<?php bloginfo('template_url') ?>/images/logo.jpg" /></a>

Now, I see that every page is linking to itself..I need more tweaking to this. Every page should link to the category it belongs to. What should I replace single_cat_title(); with?

Thanks