• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Add Divs To Comments Template

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Add Divs To Comments Template

This topic is: not resolved
  • This topic has 2 replies, 2 voices, and was last updated 10 years ago by lsilver.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • May 12, 2016 at 1:55 pm #185487
    lsilver
    Member

    I want to move the comments template to a different area other than After Entry, and then wrap it in a couple of divs. Moving it is no problem but I'm having a hard time figuring out how to wrap it in divs. I tried the code below and the divs are output, but the comments section is actually output outside of the divs (even though I'm wrapping it in the code). Suggestions?

    //* Change Comment Position
    remove_action('genesis_after_entry','genesis_get_comments_template');
    add_action('genesis_before_footer', 'cmm_move_comments',0);
    function cmm_move_comments() {
        echo '<div id="custom-comments-wrapper"><div id="custom-comments-inner">';
        add_action('genesis_before_footer','genesis_get_comments_template');
        echo '</div></div>';
    }
    May 12, 2016 at 5:29 pm #185501
    Christoph
    Member

    Hi,

    no need to use an add_action inside of the function.
    Try just calling
    genesis_get_comments_template();

    //* Change Comment Position
    remove_action('genesis_after_entry','genesis_get_comments_template');
    add_action('genesis_before_footer', 'cmm_move_comments',0);
    function cmm_move_comments() {
        echo '<div id="custom-comments-wrapper"><div id="custom-comments-inner">';
        genesis_get_comments_template();
        echo '</div></div>';
    }

    https://www.christophherr.com | Genesis Customizations | Buy me a coffee

    May 12, 2016 at 5:32 pm #185502
    lsilver
    Member

    Woot! Thanks. I knew I was close. I appreciate the help. Was playing with that for hours.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble