Okay
  Public Ticket #2586343
Page Template doesn't have comment form in it
Closed

Comments

  • Legendream started the conversation

    As you know, Wordpress allows users to allow or disallow comments on a specific page or post through the backend. However, your page templates don't have the comment section in them regardless of whether the comments are turned on for the specific page via wordpress or not.

    Don't get me wrong, I don't need your help to make comments show up on my page. I already opened the page template and added it in myself. But this is a dirty solution because it doesn't allow me to update the version of Salient without worrying that my changes will be overwritten. Yes, I can copy paste the default template into the child theme but this will make it so that the template isn't updated if there are updates to it in the future.

    This is a change I've had to make multiple times for multiple Salient based sites I've worked on and I'm tired of having to change it over and over and over again.

    Therefore, could you please update Salient page templates to show comments and commenting form when they are supposed to?

    And by "when they are supposed to" I mean when that page has "allow comments" set to true or if that page has them set to false but there are comments already present for that page in the database.

  •  1,075
    ThemeNectar replied

    Hey Legendream,

    I've noted to create a simple filter that can be enabled for this. However, for now if you'd like to handle it in a cleaner, update-proof fashion, you can use the "nectar_hook_after_content" hook.

    Here's an example that you can add into your child theme functions.php:

    add_action('nectar_hook_after_content', 'salient_child_page_comments', 10);
    function salient_child_page_comments() {
        if( is_page() ) {
            comments_template();
        }
    }
    

    Cheers

  • Legendream replied

    Yeah, that works. Haven't thought of that solution. Thanks.