Why doesn’t this work for me? I am trying to output this sitemap link only on the homepage.
On the footer.php file I have
PHP Code:
<?php get_footer(); ?>
I added this code in the WP admin html footer that I found on the net
<?php if ( is_home() AND !is_paged() ) { ?>
<a href="sitemap.xml">Sitemap</sitemap>
<?php } ?>
that didn't work so I tried this
<?php if ( is_home() ) { ?>
<a href="sitemap.xml">Sitemap</sitemap>
<?php } ?>
but the link is shown across all pages.
How can I get this to work? Thanks