• 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 comment form to archive posts

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 › Design Tips and Tricks › Add comment form to archive posts

This topic is: not resolved

Tagged: comment form

  • This topic has 7 replies, 3 voices, and was last updated 7 years, 9 months ago by simbasounds.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • August 13, 2015 at 12:25 pm #162273
    simbasounds
    Member

    I'm looking for a function to add a comment form at the end of posts in archives. I tried the following with various hooks:

    function add_genesis_comments() {
    	if (is_archive()) {
    		add_action( 'genesis_after_entry', 'genesis_get_comments_template' );
    	}
    }
    add_action( 'wp_enqueue_scripts', 'add_genesis_comments' );
    December 9, 2015 at 6:26 am #173297
    Susan
    Moderator

    As you posted this a while ago, I’m hoping that you were able to get your issue resolved 🙂 – if not, report back here, so it can be escalated.

    December 9, 2015 at 7:45 am #173316
    simbasounds
    Member

    I can't even remember what this was for, but no, I don't think I managed to solve it.
    If the forum is to be considered a resource of knowledge, then it should probably be answered.
    Thanks

    December 9, 2015 at 8:21 am #173323
    Susan
    Moderator

    The forum is made up of volunteers, who answer questions as they have availability, or the knowledge to assist. There is no guarantee that you will receive a response, nor is it official StudioPress support, but I'm happy to escalate to see if someone can give you an answer.

    December 9, 2015 at 8:37 am #173330
    simbasounds
    Member

    Thanks Susan, yes I understand that. I simply meant in a general sense that if someone had the same issue they could come here and find the answer, seeing as it's probably something that people would need ie. the ability to have comments in a blog archive. No pressure whatsoever : ) Most humbly grateful to the volunteers..

    December 9, 2015 at 8:42 am #173331
    Susan
    Moderator

    Gotcha (we just get people who have expectations beyond the scope of this forum!)

    I have asked over on the Genesis Slack Group to see if someone can give some insight, so I'm hoping someone will pop by shortly with an answer for you.

    December 11, 2015 at 9:58 pm #173568
    Christoph
    Member

    Hi,

    you can try this:

    function add_genesis_comments() {
    	global $withcomments;
    	if ( is_archive() || is_home() ) {
    	$withcomments = 1;
    	comments_template();
            }
    }
    
    add_action( 'genesis_after_entry', 'add_genesis_comments' );

    Adjust the conditional to your needs.

    genesis_get_comments_template will only return the comment template on single posts or pages.
    comments_template alone will also only work on single posts or pages. That´s why you need $withcomments.


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

    December 11, 2015 at 10:25 pm #173584
    simbasounds
    Member

    Coincidentally the project I'm working on now has this requirement again, so big thanks, Christoph!

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Design Tips and Tricks’ 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

© 2023 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