Jump to content


Photo
- - - - -

Restricting links in footer to front page


This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1 rusty

rusty

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 08 May 2010 - 05:39 AM

I have added a row of links to my footer just above the PageLines image/link in iBlog Pro 3. I want these links to appear only on my front page. I'm using the default Feature Page template on my front page.

Usually when I want links to appear only on my index page I use this code:

<?php if (is_home()){ ?>CONTENT HERE
<?php } // end of the if ?>

But wrapping this code around the links makes them disappear from all pages, including the front page where I want them to show. Any ideas as to how I can get these links to show in the footer ONLY on my front page?

Thanks in advance.

#2 Jackey

Jackey

    Advocate

  • Members


  • 685 posts

Posted 10 May 2010 - 08:30 AM

Hi Rusty, is_Home() is your blog page... not necessarily your frontpage.

#3 Jackey

Jackey

    Advocate

  • Members


  • 685 posts

Posted 10 May 2010 - 11:40 AM

Btw when you make use of widgets to display your links, there are plugins to achieve just that... Plugins like "TS Custom Widgets v2.0 WP" for example.

#4 rusty

rusty

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 10 May 2010 - 05:59 PM

oh yeah, ok that makes sense! Yes, I have a static page as my front page. Any ideas how I can modify that code to show the links on a single static page? I'll look into that widget, but this is not in a sidebar, it's in the footer content below the text navigation links and above the pagelines graphic. Thanks again.

#5 rusty

rusty

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 10 May 2010 - 06:37 PM

Right, so as I suspected, the plugin doesn't work for my purpose because the area where I'm trying to put the links is not in a defined widget/sidebar area. I've found that by changing the first part of the code to <?php if (is_Page()){ ?> I can get the links to display on static pages and not on the blog but I only want them to display on one particular page, not all of them. I've tried replacing "Page" with the name of the php file for the default feature page template but that doesn't seem to work. Any more ideas out there? Please help! Thanks. Rusty

#6 arpowers

arpowers

    Founder

  • Administrators
  • 3270 posts

Posted 11 May 2010 - 04:44 AM

You could just use `is_front_page()` :)

#7 rusty

rusty

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 11 May 2010 - 05:34 AM

oh snap. I was leaving out the underscore when I tried frontpage but that did it. thanks a million.