Notifications
Clear all

[Solved] Changing location of comment form on page

6 Posts
2 Users
0 Reactions
1,955 Views
(@jerick)
Active Member
Joined: 5 years ago
Posts: 5
Topic starter  

Hi, is it possible to move the comment form to a higher point on my page. Right now, it's too far down. It's below the related posts, but I would like it right below the current post. Thanks in advance!

This topic was modified 5 years ago by jerick

   
Elvina
(@elvina)
Support
Joined: 5 years ago
Posts: 1403
 

Hi @jerick,

As far as wpDiscuz is being loaded via <?php comments_template() > function, you can change the comment form position by simply relocating the function's position in template files.

More info here: https://developer.wordpress.org/reference/functions/comments_template/


   
(@jerick)
Active Member
Joined: 5 years ago
Posts: 5
Topic starter  

Hi Elvina, 

thanks for the advice. Just to be sure, do you mean I have to relocate the function in each of the relevant files? So if I have 10 custom post types which I want to move the comment sections in, I will have to do that 10 times? 


   
(@jerick)
Active Member
Joined: 5 years ago
Posts: 5
Topic starter  

I went to take a look at my theme templates to get a better understanding. It doesnt seem possible to do what I want to in the theme editor, which is to insert the comment form within the content area. The content is output as a whole unit by the "the_content" function. Is there a way to edit the "the_content" function?


   
Elvina
(@elvina)
Support
Joined: 5 years ago
Posts: 1403
 

Hi @jerick,

thanks for the advice. Just to be sure, do you mean I have to relocate the function in each of the relevant files? So if I have 10 custom post types which I want to move the comment sections in, I will have to do that 10 times? 

Yes you should change the position of the <?php comments_template() > function for each custom post type.

 It doesnt seem possible to do what I want to in the theme editor, which is to insert the comment form within the content area. The content is output as a whole unit by the "the_content" function. Is there a way to edit the "the_content" function?

There is no necessary to make changes in the_content function.
If the comment form is visible then the <?php comments_template()> function exsists for sure.

Probably you've imported the template files, thus <? php comments_template ()> was being replaced with <? get_comments()> function or something like that. So you'll need to find the function that is used instead of the comments_template ().


   
(@jerick)
Active Member
Joined: 5 years ago
Posts: 5
Topic starter  

@elvina

Thanks so much for your help. While working on the solution, I realized that it's probably  better that my comments section is left at the bottom. But nevertheless, your solution helped me understand the template files better, and may come in handy in future should I change my mind on the comments section 🙂 Bye for now!


   
Share:
Scroll to top