Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   php in footer.php - links to just show up on homepage (http://forum.bytesforall.com/showthread.php?t=66)

chris Dec 20, 2008 08:39 AM

php in footer.php - links to just show up on homepage
 
Hello,

I used to have some links that only show up on the "home" page -
I have had following code in my previous theme

PHP Code:

<?php if($HTTP_SERVER_VARS['REQUEST_URI']=="/") : ?>
<p>link1 ... link2</p>
<?php endif; ?>

this didn't work anymore ... no links show up on the homescreen or elsewhere ...

I placed it right over

HTML Code:

                </td>
                <!-- / Footer -->

in footer.php

any idea?

Flynn Dec 20, 2008 12:21 PM

Not sure why but you could try this:

PHP Code:

<?php if ( is_home() AND !is_paged() ) { ?>
links
<?php ?>

or if you're using a static page as the homepage

PHP Code:

<?php if ( is_front_page() ) { ?>
links
<?php ?>


chris Dec 20, 2008 12:38 PM

Thanks - that works.

copywrite May 9, 2010 11:22 AM

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 wp_footer(); ?> <?php get_footer(); ?> <?php if ( is_home() AND !is_paged() ) { ?>
<a href="sitemap.xml">Sitemap</sitemap>
<?php ?>

I have tried adding the html code in the WP admin footer but the link is shown across all pages.

How can I get this to work? Thanks

juggledad May 9, 2010 11:36 AM

What version of Atahualpa and WP?
When I put that code in replacing line 92 (in version 3.4.6) I only see the link on the first of my blog pages.
Have you made anyother modifications?

copywrite May 9, 2010 11:52 AM

Thanks for the reply. It is a theme I downloaded.

Uopdated: I am trying to output this sitemap link only on the homepage.

On the footer.php file I have
PHP Code:
HTML Code:

<?php get_footer(); ?>
HTML Code:

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[/php]

juggledad May 9, 2010 12:50 PM

If it is not atahualpa, I suggest you go ask the themes author


All times are GMT -6. The time now is 06:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.