Replacing Primary sidebar on front page

Community Forums Forums Design Tips and Tricks Replacing Primary sidebar on front page

This topic is: resolved

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

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #43022

    mjcollins
    Participant
    Post count: 3

    I’m using the Going Green theme and I’m trying to replace the Primary Sidebar only on the front page with a custom Sidebar. I am a real newbie to coding etc but do understand that I need to register a sidebar and then put code somewhere to activate.

    I would appreciate help on:

    - The code I need to use to do this

    - Where precisely I need to put the code

    - Also – if anyone can point me in the direction of reading material on how to generally modify themes using coding that would be great.

    Apologies if this sounds basic, but I have been going around in circles in the forums. Thanks! Mike.

    http://www,youririshheritage.com
    #43028

    braddalton
    Participant
    Post count: 10556

    Whats the difference between the default primary sidebar and what you want on the home page?

    Have you tried the Genesis Layout Extra’s plugin?


    #43030

    mjcollins
    Participant
    Post count: 3

    The difference I want is:

    Static Home Page: Sidebar has NO email signup at top (it is contained in page content instead)

    All other pages: Sidebar has email signup at top.

    (www.youririshheritage.com homepage shows what I dont want at the moment!)

    Thanks – Mike.

    #43035

    braddalton
    Participant
    Post count: 10556

    You could simply install the Widget Logic plugin and add a conditional tag to the widget you want displayed based on these conditions.

    Another option, if using a static page as your front page is to install the Simple Sidebars plugin and create a custom sidebar which can be selected for use on any page.

    If you’re not using a static page as your front page, then the Widget Logic plugin is the best solution.

    Use:
    [php]
    is_home displays the widget on the home page only
    [/php]
    or
    [php]
    !is_home displays on all pages excluding the home page
    [/php]

    Use:
    [php]
    is_front_page if using a static page as your front page.
    [/php]


    #43037

    mjcollins
    Participant
    Post count: 3

    I used Widget logic as you suggested – which should work in theory as follows (?) – I am using a static frontpage:
    is_front_page should display the email widget on the front page only BUT the widget is still displaying on all pages
    then I tried !is_front_page which should display on all except front page BUT is is now not displaying widget on any pages.

    Not sure whats going on – but feels like I’m almost there.

    #43038

    braddalton
    Participant
    Post count: 10556

    Try is_home use the page for the home page which you can grab from the source code and use it like this:

    [php]
    is_page(’007′)
    [/php]


    #43066

    mjcollins
    Participant
    Post count: 3

    That works – I used

    !is_page('021')
    to exclude widget from the homepage.

    I assume that 21 is a static address for that page?

    Thanks a lot for your help, Mike.

    #43156

    braddalton
    Participant
    Post count: 10556

    Affirmative Mike. It’s the unique i.d for that page which you can view in the source code.


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

You must be logged in to reply to this topic.