Okay
  Public Ticket #920349
show parent category and subtitle together on portfolio item
Closed

Comments

  •  1
    Achim started the conversation

    Hi, could you please help me to do the change in a child theme.

    I want to show both: item category (or categories) and the subtitle under the title of portfolio item.

    In themeoptions I only can select subtitel or category but no and.

    In witch php-file is may I find this? 

    THX
    Achim

  • [deleted] replied

    Hi Achim,

    This file contains the links for categories/y and sub title:

    wp-content/themes/kalium/tpls/portfolio-loop-item-categories.php

    and modify the code to look like this:

    // What to show
    $portfolio_loop_subtitles = $portfolio_args['subtitles'];

    // Hide option is selected
    if ( $portfolio_loop_subtitles == 'hide' ) {
    return;
    }

    // Show Subtitle
    if ( $portfolio_item_subtitle ) {
    echo '<p class="sub-title">' . do_shortcode( $portfolio_item_subtitle ) . '</p>';
    }

    // Categories
    if ( ! empty( $portfolio_item_terms ) ) {
    $j = 0;

    echo '<p class="terms">';

    foreach ( $portfolio_item_terms as $term ) :

    // Term Separator
    echo $j > 0 ? ', ' : '';

    ?><a href="<?php echo esc_url( kalium_portfolio_get_category_link( $term ) ); ?>" data-term="<?php echo esc_attr( $term->slug ); ?>">
    <?php echo esc_html( $term->name ); ?>
    </a><?php

    $j++;

    endforeach;

    echo '</p>';
    }

    This will work for you. 

    Also don't forget to move this file in child theme because upcoming updates will replace it again if left in parent theme folder.