Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m quoting here from the theme author’s forum:

    The theme doesn’t have comments on “pages” built in by default. You can have comments on “posts” but for pages you have to add this to your page template file right before the closing div:

    <?php comments_template('templates/comments.php'); ?>

    I suggest using a child theme for the edits

    Thread Starter coconutlimenutrition

    (@coconutlimenutrition)

    Thank you Obi, but what does all that mean? “closing div” and child’s theme? I do not know code…

    Thanks!

    The Virtue theme (I assume you’re using the free version) includes comments on posts but doesn’t include comments on pages.

    To make comments appear on your pages, you would need to edit your theme’s page.php file.

    But if you change that file, the first time your theme is updated to a new version your changes would be overwritten and lost. This is why it’s best to use a child theme with a customized page.php file:

    With a child theme, you can update the parent theme (which might be important for security or functionality) and still keep your changes.

    It’s not as difficult as it sounds, but you’ll need a simple text editor (such as Notepad/Notepadd++) to create the necessary files and a way to upload those files to your server (using an FTP program like Filezilla or your hosting account’s file manager utility).

    Here is what you’ll need to do:

    1) Create a new directory called virtue-child on your server in the /wp-content/themes/ directory. This is where you’ll upload your child theme files.

    2) Create 2 files called style.css and page.php as follows.

    Open your text editor and create a new file. Paste in the following code –

    /*
     Theme Name:   Virtue Child
     Template:     virtue
    */
    
    @import url("../virtue/style.css");
    
    /* =Theme customization starts here
    -------------------------------------------------------------- */

    Save this file as style.css

    Next, create a new file in your text editor and paste in the following code.

    <div id="pageheader" class="titleclass">
    		<div class="container">
    			<?php get_template_part('templates/page', 'header'); ?>
    		</div><!--container-->
    	</div><!--titleclass-->
    
        <div id="content" class="container">
       		<div class="row">
          <div class="main <?php echo kadence_main_class(); ?>" role="main">
    
    <?php get_template_part('templates/content', 'page'); ?>
    <?php comments_template('templates/comments.php'); ?>
    </div><!-- /.main -->

    Save this file as page.php

    3) Upload style.css and page.php to the /wp-content/themes/virtue-child/ directory you created in step 1.

    4) Activate the child theme. Log in to your site’s dashboard, and go to Administration Panels > Appearance > Themes. You will see your child theme listed there. Click Activate.

    Thread Starter coconutlimenutrition

    (@coconutlimenutrition)

    Thank you…this sounds so complicated. But I will keep these notes and if I get up the nerve will attempt this.

    Thanks!!

    Krisha

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Comments in Pages not working’ is closed to new replies.