Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

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


  #1  
Old Dec 20, 2008, 09:39 AM
chris's Avatar
chris
 
39 posts · Dec 2008
essen@nrw.de
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?
  #2  
Old Dec 20, 2008, 01:21 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
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 ?>
  #3  
Old Dec 20, 2008, 01:38 PM
chris's Avatar
chris
 
39 posts · Dec 2008
essen@nrw.de
Thanks - that works.
  #4  
Old May 9, 2010, 12:22 PM
copywrite
 
2 posts · May 2010
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
  #5  
Old May 9, 2010, 12:36 PM
juggledad's Avatar
juggledad
 
23,560 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #6  
Old May 9, 2010, 12:52 PM
copywrite
 
2 posts · May 2010
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]
  #7  
Old May 9, 2010, 01:50 PM
juggledad's Avatar
juggledad
 
23,560 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
If it is not atahualpa, I suggest you go ask the themes author
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
make index.php be a "page" and blog postings go to different php page zhidoni Atahualpa 3 Wordpress theme 0 Jun 21, 2009 05:25 PM
[SOLVED] messed up header.php and footer.php monochrome Header configuration & styling 0 Jun 20, 2009 03:16 PM
request: please add "links.php" page template. dhani Atahualpa 3 Wordpress theme 0 May 22, 2009 04:36 AM
how do i get comments to show up on homepage for each post??? drewjones Comments, trackbacks & pings 2 Apr 15, 2009 08:04 PM
Post PHP on one page only, and not homepage blueprairie Plugins & Atahualpa 2 Apr 2, 2009 08:28 AM


All times are GMT -6. The time now is 10:43 PM.


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