Digital experiences for all disciplines
New Landing › How can we help? › Cardinal › Adding category
New Landing › How can we help? › Cardinal › Adding category
- This topic has 19 replies, 3 voices, and was last updated 9 years by Rui Guerreiro – SUPPORT.
-
Posted in: Cardinal
-
January 7, 2015 at 11:48 am #139637
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!
January 7, 2015 at 3:50 pm #139728Hi,
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
January 7, 2015 at 8:10 pm #139770This reply has been marked as private.January 8, 2015 at 11:36 am #139951Hi
Have you managed to output anything at all?
– Kyle
January 8, 2015 at 2:22 pm #140018No, except from array… then again, I’m not a php specialist.
Thanks.
January 8, 2015 at 2:38 pm #140031I don’t see the array output?
– Kyle
January 8, 2015 at 7:32 pm #140178Sorry, it’s there now.
Thanks!
January 9, 2015 at 2:45 pm #140366Hi,
Can you provide Ftp access to check the source code?
Thanks-Rui
January 9, 2015 at 3:28 pm #140382This reply has been marked as private.January 12, 2015 at 10:50 am #140858Hi,
Made some modifications. Check again that page.
-Rui
January 12, 2015 at 3:17 pm #140960That is brilliant!!!! Thank you so much!
January 12, 2015 at 3:23 pm #140961Thanks Rui
February 10, 2015 at 9:01 am #148616Hi, 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!
February 10, 2015 at 9:08 am #148622I’ve forwarded this to Rui for you
– Kyle
February 14, 2015 at 11:55 pm #150180Thank you! Any luck with this so far?
Thanks!
-
Posted in: Cardinal
You must be logged in and have valid license to reply to this topic.