Fix #353 - Add conditional feed link, thanks @zslabs

This commit is contained in:
Ben Word
2012-04-10 21:20:44 -06:00
parent 53dc8f3b2b
commit c1ee5717bd
2 changed files with 8 additions and 2 deletions

View File

@@ -10,8 +10,6 @@
<meta name="viewport" content="width=device-width">
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> Feed" href="<?php echo home_url(); ?>/feed/">
<script src="<?php echo get_template_directory_uri(); ?>/js/libs/modernizr-2.5.3.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

View File

@@ -1,5 +1,13 @@
<?php
function roots_feed_link() {
$count = wp_count_posts('post'); if ($count->publish > 0) {
echo "\n\t<link rel=\"alternate\" type=\"application/rss+xml\" title=\"". get_bloginfo('name') ." Feed\" href=\"". home_url() ."/feed/\">\n";
}
}
add_action('roots_head', 'roots_feed_link');
function roots_google_analytics() {
$roots_google_analytics_id = GOOGLE_ANALYTICS_ID;
if ($roots_google_analytics_id !== '') {