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.

Having recently installed a theme update on an inherited premium theme, I am facing a minor irritation that I do not have the coding knowledge to solve.

The theme displays a link to RSS feeds for archive and category pages but for some reason the new php file breaks the link - it displays correctly on the page but the hyperlink remains dead. I kept a copy of the old theme files so I am able to at least provide the differences in the code snippets.

(If I add both to the file, although the page obviously displays the links twice, one of them will work, but either one on its own results in no clickable link to the feed).

Here is the code from the old theme file:

<h3><span class="fl">Archive | <?php echo single_cat_title(); ?></span> <span class="fr catrss"><?php $cat_obj = $wp_query->get_queried_object(); $cat_id = $cat_obj->cat_ID; echo '<a href="'; get_category_rss_link(true, $cat, ''); echo '">RSS feed for this section</a>'; ?></span></h3> 

and here is what I have in the new one:

<h3><span class="fl"><?php _e('Archive', 'woothemes'); ?> | <?php echo single_cat_title(); ?></span> <span class="fr catrss"><?php $cat_obj = $wp_query->get_queried_object(); $cat_id = $cat_obj->cat_ID; ?><a href="<?php get_category_rss_link(true, $cat, ''); ?>"><?php _e('RSS feed for this section', 'woothemes'); ?></a></span></h3>  

I am afraid that as I do not have a membership to the theme provider's site I cannot get help from that avenue without paying a costly fee and as I'm not a customer of theirs I'm reluctant to pay so much in order to ask what is probably a simple question.

Thanks in advance for any help that can be offered here.

EDIT: When looking at the page source in FF the output appears to be correct yet still the link is not functioning. Here is the relevant output as seen in the page source:

<h3>
<span class="fl">Archive | Wordpress</span>
<span class="fr catrss">
            <a href="http://www.thecaymanhost.com/category/wordpress/feed">
        RSS feed for this section        </a>
</span>

As you can see the feed is valid and the html would appear to be correct.

share|improve this question
    
Do you mean the href part of the <a> tag is empty, or that the page it links to is empty? –  Jan Fabry Sep 11 '11 at 7:50
    
The href part of the tag is generating the text but not linking to anything even though when I look at the page source in Firefox it appears to be generating the correct html tags. The feed it should link to is fine and working as it should. –  Maurice Sep 11 '11 at 17:12
    
That is weird, can you edit your question and add the HTML source it generates? –  Jan Fabry Sep 11 '11 at 17:20
    
I've edited the question accordingly. Thank you. –  Maurice Sep 11 '11 at 17:37

2 Answers 2

This is not a PHP or HTML issue, but a CSS issue. Your top menu is overlapping with the top of the content, so when you place the mouse over the link you are in fact still hovering over the top menu. You can see this in the developer tools of your browser:

Top part of content obscured by top menu

If I remove the height: 33px from #topmenu, the content shifts a bit down and the link becomes clickable again:

Content div shifted down so link becomes clickable

share|improve this answer
    
Thanks so much for looking into this for me and providing a solution. I tried deleting the line from the styles.css file but it didn't appear to make any difference so not sure what I'm doing wrong. I need to reduce the number of categories in any case as it all looks rather cluttered. I'm not sure why your suggestion is not working for me though, probably because I'm a dummy but I'll figure it out I'm sure. Thanks again for narrowing down the cause. –  Maurice Sep 11 '11 at 18:37

get_category_rss_link is a deprecated function, use get_category_feed_link instead.

<h3>
    <span class="fl"><?php _e('Archive', 'woothemes'); ?> | <?php echo single_cat_title(); ?></span>
    <span class="fr catrss">
        <?php $cat_obj = $wp_query->get_queried_object(); ?>
        <a href="<?php echo get_category_feed_link($cat_obj->cat_ID, ''); ?>">
            <?php _e('RSS feed for this section', 'woothemes'); ?>
        </a>
    </span>
</h3>  
share|improve this answer
    
thanks for looking into this so promptly for me. Unfortunately it has not resolved the problem and the link to the feed is still not live. –  Maurice Sep 11 '11 at 6:39
    
@Maurice - what appears in the href, is it empty? the code works in isolation, so can't really help you beyond that without seeing what else is going on, maybe something is stepping on the $wp_query global. try print_r($cat_obj) to make sure it contains what you expect. –  Milo Sep 11 '11 at 7:03
    
sorry but not sure what you mean by the code above - my coding knowledge is limited at best. In the page source code the output appears to be correct for the hyperlink so I'm not at all sure why it isn't working on the page itself. –  Maurice Sep 11 '11 at 8:39

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.