Enabling comments in portfolio items
This support request was posted in Netelier by scottepond
- scottepond February 10, 2014 at 12:48 am
I’m looking for a way to edit the php to allow commenting on portfolio items. I’ve seen methods to do so on other themes. Is there a way to do it on the Netelier theme? (Note: I am a newbie when it comes to php).Juanfra Aldasoro February 10, 2014 at 2:03 pm
Thanks for writing. Yes, there’s a simple way. You’ll need to call the comments function in your single-portfolio.php file:
comments_template( '', true );
You can check the file single.php in order to check where and how to include it 🙂
Juan.scottepond February 10, 2014 at 6:36 pm
Thanks Juan. I’ll give that a try as soon as my flight lands. Cheers!Juanfra Aldasoro February 10, 2014 at 10:10 pm
Thanks for writing back.
No problem 🙂
Juan.scottepond February 13, 2014 at 5:45 am
Juan: I tried updating the single-portfolio.php file like it indicates on the single.php file… all that happens is a line is drawn at the top of the portfolio. I tried it in a few locations in the file but it doesn’t seem to activate comments. Any recommendations?scottepond February 13, 2014 at 5:56 am
Update: I was able to get it in the code to show up where I want it, but it only appears as a line, not as a the actual comments. Is there something else that I need to do to ensure it is expanded?scottepond February 13, 2014 at 6:00 am
You can see the line below the image in the following link: http://scottpond.com/scotteponddesigns/portfolio/slingers-book-1/Juanfra Aldasoro February 13, 2014 at 1:46 pm
Thanks for writing.
I forgot to mention that you’ll have to edit the way the portfolio custom post type is registered.
Open the following file /includes/custom-post-types/portfolio.php and where it says:
'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes', 'excerpt' )
'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes', 'excerpt', 'comments' )
Once you have done that, remember to check the discussion feature while editing/creating the portfolio item. This would be: When creating/editing a page, have a look on the top right part of the screen. You’ll see a button that says “Screen Options”. Click that.
A panel with the screen options will be toggled. There you can check the “Discussion” checkbxox.
In the form you’ll see that there’s a new box, named “Discussion”. There you can enable/disable comments.
Have a nice day.
Juanscottepond February 14, 2014 at 2:44 am
Thanks Juan! That did the trick.
Last question: is there a way to make new portfolios automatically have the “allow comments” under the discussion setting be defaulted to “checked”?Juanfra Aldasoro February 14, 2014 at 2:22 pm
Thanks for the follow up.
I’m afraid that has to do with WordPress. As far as I’m concerned that’s a bit random. I’m sorry I can’t help you on this one
Juan.scottepond February 14, 2014 at 4:22 pm
No worries, thanks for the great help Juan! This one can be closed out.Juanfra Aldasoro February 14, 2014 at 4:38 pm
Thank you 🙂
Have a nice weekend,
This topic is marked as resolved
Only the topic author can re-open this thread.