New Landing How can we help? Cardinal Adding category

Viewing 15 posts - 1 through 15 (of 20 total)
  • Posted in: Cardinal
  • #139637
    bram1974
    Member
    Post count: 94

    Hi,

    I would like to simply display the category above the Portfolio title. I have located where I need to add some lines (sf-portfolio.php) but it keeps coming back with array.

    I’ve tried the following:

    
    $portfolio_items_output .= $categories = get_the_category( $post->ID );
    

    In this:

    
    /* THUMBNAIL CONFIG
                    ================================================== */
                    if ( $thumb_type != "none" ) {
                        $portfolio_items_output .= sf_portfolio_thumbnail( $display_type, $masonry_thumb_size, $multi_size_ratio, $columns, $hover_show_excerpt, $excerpt_length, $gutters, $fullwidth );
                    }
                    
                    $portfolio_items_output .= apply_filters( 'sf_after_portfolio_item_thumb' , '');
    
                    if ( $display_type != "gallery" && $display_type != "masonry-gallery" && $display_type != "multi-size-masonry" ) {
    
                        $portfolio_items_output .= '<div class="portfolio-item-details">' . "\n";
    
                        if ( $show_title == "yes" ) {
    
                            $portfolio_items_output .= '<div class="comments-likes">';
                            if ( function_exists( 'lip_love_it_link' ) ) {
                                $portfolio_items_output .= lip_love_it_link( get_the_ID(), false );
                            }
                            $portfolio_items_output .= '</div>';
                            
                            $portfolio_items_output .= '<h3 class="portfolio-item-title" itemprop="name headline"><a ' . $item_link['config'] . '>' . $item_title . '</a></h3>' . "\n";
                        }
                        if ( $show_subtitle == "yes" && $item_subtitle ) {
                            $portfolio_items_output .= '<h5 class="portfolio-subtitle" itemprop="name alternativeHeadline">' . $item_subtitle . '</h5>' . "\n";
                        }
                        if ( $show_excerpt == "yes" ) {
                            $portfolio_items_output .= '<div class="portfolio-item-excerpt" itemprop="description">' . $post_excerpt . '</div>' . "\n";
                        }
    
                        $portfolio_items_output .= '</div>' . "\n";
    
                    }
    
                    $portfolio_items_output .= '</li>' . "\n";
    
                    $count ++;
    
                endwhile;
    
                wp_reset_query();
                wp_reset_postdata();
    
                $portfolio_items_output .= '</ul>' . "\n";
    

    Would you be able to hep with this?

    Many thanks!

    #139728
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Can you provide the url of the page where the array is displaying. Probably you have several categories for each Portfolio item.

    Also try to get the first category only.

    
    $portfolio_items_output .= get_the_category( $post->ID )[0];
    

    -Rui

    #139770
    bram1974
    Member
    Post count: 94
    This reply has been marked as private.
    #139951
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    Have you managed to output anything at all?

    – Kyle

    #140018
    bram1974
    Member
    Post count: 94

    No, except from array… then again, I’m not a php specialist.

    Thanks.

    #140031
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    I don’t see the array output?

    – Kyle

    #140178
    bram1974
    Member
    Post count: 94

    Sorry, it’s there now.

    Thanks!

    #140366
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Can you provide Ftp access to check the source code?
    Thanks

    -Rui

    #140382
    bram1974
    Member
    Post count: 94
    This reply has been marked as private.
    #140858
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Made some modifications. Check again that page.

    -Rui

    #140960
    bram1974
    Member
    Post count: 94

    That is brilliant!!!! Thank you so much!

    #140961
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Thanks Rui

    #148616
    bram1974
    Member
    Post count: 94

    Hi, I’ve updated to the latest Cardinal theme and the line we’ve added isn’t outputting anything anymore:

    $portfolio_items_output .= '<h3 class="category">'. $term_name . '</h3>' . "\n";

    Any idea why this would be?

    Many thanks!

    #148622
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    I’ve forwarded this to Rui for you

    – Kyle

    #150180
    bram1974
    Member
    Post count: 94

    Thank you! Any luck with this so far?

    Thanks!

Viewing 15 posts - 1 through 15 (of 20 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register