Comments on Landing Page

  • Christine Crawford

    #2130

    Hi,

    I want to put comments on my landing page so it appears more like a facebook/social media page. I found a post that said to use

    Code:
    function graphene_force_comment(){
    $withcomments = 1; // force comments form and comments to show on front page
    comments_template();
    }
    add_action(‘graphene_bottom_content’, ‘graphene_force_comment’);

    in the functions.php. It says it is untested. I did this but it doesn’t seem to work. Is there a solution?

    Anonymous

    #18847

    Which forum post did you pull that from, so I can review it. Can you post the link here?

    I don’t mean to step on the mods toes, but in the future I would post questions like this into the “Support” section of the forum.

    PizzaDave

    #18848

    Anonymous

    #18849

    No worries, the “powers that be” will move it if it needs to be moved.

    Okay, are you using a child theme with a functions.php file in it?

    PizzaDave

    #18850

    No, I’m fairly new at this. I have been using the theme I downloaded from wordpress.org so it fairly clean except for the plugins I have added.

    I tried putting it in the functions.php but it didnt seem to work.

    I had also found the code earlier in a forum blog.

    Code:
    <?php
    $withcomments = 1;
    comments_template();
    ?>

    http://wordpress.org/support/topic/how-to-show-comments-on-home-page

    which I tested in various places in the loop.php and any place else I could think of but couldn’t get it to work.

    I even tested it with “1”, 1, and true but no joy.

    Anonymous

    #18851

    Okay, you really need to create a child theme before you go around making all kinds of “core” adjustments… or you won’t be able to update without losing ALL of your customizations.

    So, first create a child theme. You can follow Syahir’s guide here:

    https://forum.graphene-theme.com/graphene-support/how-to-modify-the-theme-using-a-child-theme

    Or my video tutorial here:

    Once you have done this, post back and I’ll guide you the rest of the way.

    PizzaDave

    #18852

    Ok, with you so far.

    By the way thanks in advance for the help. I watched your videos on your website. Very helpful in understanding the power of this theme.

    Anonymous

    #18853

    Great!!

    Ok, so now you should have a functions.php file in your child theme? Now, paste the function above between the opening and closing php tags. It should look like this:

    <?php
    function graphene_force_comment(){
    $withcomments = 1; // force comments form and comments to show on front page
    comments_template();
    }
    add_action('graphene_bottom_content', 'graphene_force_comment');
    ?>

    Again, I haven’t tested this… so see if it works and post back 🙂

    PizzaDave

    #18854

    Unfortunately it does not work. It did put a repeat of a comment under a comment (or above I suppose) that was already showing in the single post area. I need the comments to show up on the home page. I am not using a static page. I’m trying to emulate a facebook wall. (I was just banned from facebook advertising)

    Any suggestions?

    I did find this exercise helpful in placing a google ad on the page the “correct” way using child themes. Using firebug was also an excellent suggestion.

    Admin

    Syahir Hakim

    #18855

    Try this instead:

    <?php
    function graphene_force_comment(){
    if ( is_home() ){
    $withcomments = 1; // force comments form and comments to show on front page
    comments_template();
    }
    }
    add_action( 'graphene_loop_footer', 'graphene_force_comment' );
    ?>

Viewing 10 posts - 1 through 10 (of 22 total)

  • You must be logged in to reply to this topic.