• Resolved andrewf12

    (@andrewf12)


    Hi,

    I would like to know if it is possible to move the default WordPress comment section from the bottom of the page to a column within the page.

    Does anyone know how to create a shortcode for the comment section so I can paste it into the page column and hide the comment section found at the bottom of the page so it’s not duplicated?

    Thanks so much fellow WordPress users!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator t-p

    (@t-p)

    what theme are you using?

    Thread Starter andrewf12

    (@andrewf12)

    Hi, Tara!

    I wasn’t sure if anyone needed that. Sorry! The theme I’m using currently is Catch Box (free version).

    Moderator t-p

    (@t-p)

    I recommend asking in this theme’s dedicated support sub-forum for better results so its developers and users can help you with this:
    https://www.ads-software.com/support/theme/catch-box

    Thread Starter andrewf12

    (@andrewf12)

    Hi,

    I tried contacting them directly, but had no luck.

    Bcworkz said the following:

    You wouldn’t use a shortcode for this unless you want it to actually appear within the content of your post or page.

    What you would do is theme dependent. Some themes display the comments by calling comment_template() from a template. Many others have a custom function for this. Whichever way is used, you would want to comment out the default call and place the same call elsewhere on the template to suit your desire.

    When one modifies theme templates, they should create a child theme so their changes are not lost when the theme is updated.

    If you tell us what theme you’re using, someone may be able to give you more specific help. Do you want this change just on page post type single pages (the final result of Pages > Add New from the admin menu), or other templates as well?

    I think Bcworkz captures exactly what I wanted to do: I want to be able to place my comment section in the page content (I’d create a second column for comments to appear beside my first column). To answer Bcworkz’s question, I’d like this applied to almost all the pages I create, but there might be cases where I want just a one column page with no comments (e.g., About Us, Contact Us, etc.). I figured a shortcode would just make life easy. I did find a plugin called Comment Form Shortcode that allows me to use a shortcode and it recreates the comment section, however the default comment section at the bottom of the page still shows.

    The problem becomes: How do I hide the comment section at the bottom? If I disable comments in admin, the shortcode doesn’t work. Any help would be awesome! Thanks, everyone!

    Moderator bcworkz

    (@bcworkz)

    With your theme, the specifics depends on which template you are using for your pages. You may need to change one of them or all of them. The process is the same for all, the exact location may vary slightly. For example, to disable comments at the bottom of the page.php template, modify line 21 like so:
    <?php /* comments_template( '', true ); */ ?>

    By making the function call a comment with the /* */, the loading of the comments template is disabled.

    Ideally, you should create a child theme and copy the files you wish to change to your child theme folder before making any changes. Otherwise you’ll need to redo this every time the theme is updated.

    Thread Starter andrewf12

    (@andrewf12)

    Hi again!

    Thanks so much for getting back so quickly. You’re awesome!

    I am a newb, so sorry if this should all be easy to get done.

    I found the page.php file and the code snippet:

    <?php
                        // If comments are open or we have at least one comment, load up the comment template
    					if ( comments_open() || '0' != get_comments_number() ) {
    						comments_template( '', true );
    					} ?>
    
    				<?php endwhile; // end of the loop. ?>

    What should I do with the code you gave me or what should I modify in the page.php’s code?

    Thanks again!

    Thread Starter andrewf12

    (@andrewf12)

    Oh, wait! I just put the /* after the <?php and then the */ just before ?> and it looked like it worked. It’s like magic really. lol. It also works with the plugin. I can see the comments where I placed the shortcode! I’m so happy. Thank you for your help. I really appreciate it. Do you know if this process is similar across all themes in general with a bit of variation or is it really different for each theme developer?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Move Comment Section on Page’ is closed to new replies.