display footer widgets only on front page

Community Forums Forums General Discussion display footer widgets only on front page

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  braddalton 1 year ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #32876

    Acrabby
    Participant
    Post count: 3

    Greetings,

    I would like to display the footer widgets only on the front page of a website, hiding it on the inner pages of the education theme.

    The url for the site is: http://ltciorg.dreamhosters.org.

    I know there are certain plugins that do this, but I’ve tried “widget context” and an empty footer widget area still shows up on the inner pages of the website.

    Does anyone know of a code snippet/hook or any other way that is available to hide the footer widgets div on all pages except the front page?

    Thanks!

     

    #32917

    braddalton
    Participant
    Post count: 7473

    There’s several ways you can do this, the Widget Logic plugin being the easiest by adding

    is_front_page() or is_home()

    to the footer widgets.

    You can then use CSS to hide anything left over.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #32924

    braddalton
    Participant
    Post count: 7473

    You can also use PHP in your child themes functions.php file:

    For front page if using a page other than the default.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #35971

    Acrabby
    Participant
    Post count: 3

    Thanks everyone! This has helped. One other related question. If you look at the site now,

    http://www.ltciorg.dreamhosters.com, you’ll see as you scroll down the page that below the “Featured” widget area with the “Read More” buttons, there is an open space. But I can’t seem to figure out how to remove that area or even what code is generating it.

    Any thoughts?

    #36013

    braddalton
    Participant
    Post count: 7473

    Try installing the Firebug addon for Firefox and inspect the element you want removed.

    You can then add {display: none;} to the class you want hidden in real time using your browser to test if it works.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.