Forums

disable comments static front page (9 posts)

  1. 4techx
    Member
    Posted 2 years ago #

    hello,
    i have set up a static front page on my website but don't want the latest comments coming up on the right hand side of the website. instead i want them to come up on all the other pages, and was wondering if this was possible.

    my website is http://www.essexandsouthendlink.org.uk, you can see how it is set up there. please note the static page is not set up there its only on my local machine at the moment, because i'm not going to put it up until it works properly.

  2. Micah Cooksey
    Moderator
    Posted 2 years ago #

    Add this to your theme's index.php:

    <?php
    if ( is_front_page() ) : get_sidebar('Sidebar 2');
    
    else : get_sidebar();
    
    endif;
    ?>

    Then, add the following to your theme's functions.php:

    if ( function_exists('register_sidebar') )
        register_sidebar(array(
    		'name' => 'Sidebar 2',
    		'before_widget' => '<div id="%1$s" class="widget %2$s">',
    		'after_widget' => '</div> <!-- end .widget -->',
    		'before_title' => '<h3 class="widgettitle">',
    		'after_title' => '</h3>',
        ));
  3. 4techx
    Member
    Posted 2 years ago #

    thank you that works, but i didn't expect to have the whole of the right hand of the screen empty! i will have to rethink my approach.

    but thank you again for your help.

  4. Micah Cooksey
    Moderator
    Posted 2 years ago #

    I forgot to mention that you now can add widgets to your "Sidebar 2" via Appearance > Widgets. That way, you have two different widget areas, one for your front page, and one for the rest.

  5. S.K
    Member
    Posted 2 years ago #

    You may try using "Widget Logic" plugin from http://wordpress.org/extend/plugins/widget-logic/

    Try using "!is_front_page()" as the logic for this particular widget (Recent comments) on the widget control admin page.

    S.K

  6. 4techx
    Member
    Posted 2 years ago #

    thanks for those tips, i am now able to configure my front page exactly how i wanted!

  7. ChironArmand
    Member
    Posted 1 year ago #

    hi there,

    my site has no sidebar and though i've removed the comments from all my other pages (referring to their id's in my page file), my homepage still does because it does not have an id. how might i go about removing the comments area there?

    http://conjureinthecity.com

    thanks in advance!

  8. MAS
    Member
    Posted 1 year ago #

    remove <?php comments_template(); ?> function from index.php file.

  9. zsuzsa
    Member
    Posted 1 year ago #

    thanks! but i'm such a novice - where do i find that?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.