Okay
  Public Ticket #185426
Adding commets to the portfolio section
Closed

Comments

  • Stefan started the conversation
    Hello, Is there any way to add comments to the portfolio items? Also, can the default pagination be renamed from www.url.com/PORTFOLIO/portfolio-item/ to www.url.com/SOMETHING-ELSE/portfolio-item ? Thank you very much. -Stefan
  •  291
    Paul replied

    Hi Stefan,

    1. Unfortunately not. You would need to customize the plugin and theme for that. Anyway, it is a great idea. I will see what I can do in the future version.

    2. To change the "portfolio" slug, you would need to manually edit the "UXbarn Portfolio" plugin code a bit. Please go to this path and open the file:

    [root]/wp-content/plugins/uxbarn-portfolio/includes/post-types.php

    Then find this line of code:

    'rewrite' 			=> array( 'slug' => __( 'portfolio', 'uxb_port' ), 'with_front' => false )

    Just edit the slug wording here. After that, on your admin panel, go to "Settings > Permalinks" and click save once. This should help.

    Cheers,
    Paul

  • Stefan replied

    Hi Paul,

    Thank you very much for your reply,

    I changed the slug and permalinks but nothing seems to happen. Maybe the permalinks didn't take. I'll try again later.

    But I really need comments on those portfolio posts. I tried looking for a comments plugin but only found one very ugly one.

    There is a workaround to my problem: I could duplicate the portfolio items and make them "posts" and link directly to them... but I was hoping for a simpler method. I have no problem getting my hands dirty and modifying code, but I'm not really a programmer. If you have any other tips (like, replace this code with that code) that would really help me out.

     

    Thanks for the help,

    Stefan

  •  291
    Paul replied

    Alright. As I have checked the code, here are where you can try customizing to enable the comment for portfolio post:

    1. In the "UXbarn Portfolio" plugin folder of WordPress, open this file:

    [root]/wp-content/plugins/uxbarn-portfolio/includes/post-types.php

    Then find this code:

    'supports' 			=> array( 'title', 'editor', 'thumbnail', 'revisions' ),

    Change it to:

    'supports'             => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),

    This will enable commenting feature on each item and now you can see "Allow Comment" checkbox on each one on your backend.

     

    2. In the "Fineliner" theme folder of WordPress, open this file:

    /uxb_templates/single-portfolio.php

    Add this code snippet into the file (you can find any proper location to place the code):

    <?php if ( comments_open() ) : ?>
                    
                    <!-- Comment Section -->
                    <div class="row">
                        <div class="uxb-col large-12 columns">
                            
                            <?php comments_template(); ?>
                            
                        </div>
                    </div>
                    
                <?php endif; ?>

    Now the comment form should display on the portfolio single page (make sure that you have ticked the checkbox "Allow Comment" for all previously added items).

    Hope this helps!

    Cheers,
    Paul