Okay
  Public Ticket #1660814
Show portfolio category in single view
Closed

Comments

  •  1
    admin-spacelab started the conversation

    Is there a way to display the categories of the displayed portfolio item in single view? Possibly in the checklist-area?



  • [deleted] replied

    Hi admin-spacelab,

    That is possible but requires code customization. Can you tell me the portfolio link (portfolio item type) that you want to display categories and probably provide a screenshot where do you want to place it so I can give you the code for that.

  •  1
    admin-spacelab replied

    Hi Arlind,

    Thank you :-)

    Please see link: http://spacelab.dk.linux2.scannetserver.dk/projekter/frederiksberg-centret/

    I'd like to automatically show the categories on the right side in checklist area (I've made a "Kategorier" checklist area to show you).

    Do you need more info?


    Thank you so much,

    Katrine

  • [deleted] replied

    Hello Katrine,

    Thats fine, I understand how do you want to show categories.

    Can you please provide your WP credentials and I'll modify the template file to show categories as well. To include your credentials click Insert Credentials button in editor toolbar. (See how)

  •   admin-spacelab replied privately
  • [deleted] replied

    Hi Katrine,

    I have modified template file to show categories for you:


    (view large version)

    So I have basically added tpls/portfolio-checklists.php in kalium-child theme and added this code above:

    $categories = get_the_terms( get_queried_object(), 'portfolio_category' );
    if ( count( $categories ) ) :
        ?>
        <div class="services row">
            <div class="checklist-entry col-sm-12">
                <h3><?php _e( 'Kategorier', 'kalium-child' ); ?></h3>
                
                <ul>
                    <?php foreach ( $categories as $term ) : ?-->
                    <li><a href="<?php echo esc_url( get_term_link( $term, 'portfolio_category' ) ); ?>"><?php echo $term--->name; ?></a></li>
                    <?php endforeach; ?>
                </ul>
            </div>
        </div>
        <?php
    endif ?>
    


    (view large version)

    I hope you like it. Please note that this is customization which i not part in the support scope and I am doing this for you only this time, I hope in your undertanding.