Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1371849

    On my portfolio grid layout, how can I show the portfolio category name?

    #1372024

    Hey navindesigns,

    Thank you for the inquiry.

    You have to modify the themes/enfold/config-templatebuilder/avia-shortcodes/portfolio/portfolio.php file and place the code below around line 1061.

     $categories = get_the_terms($key['ID'], 'portfolio_entries');
    
                            $separator = ' ';
                            $output = '<div class="av-portfolio-cat">';
                            if ( ! empty( $categories ) ) {
                                foreach ( $categories as $category ) {         
                                    $output .= '<span>' . esc_html( $category->name ) . '</span>' . $separator;
                                }
                            }
                            $output .= '</div>';
    

    You can add it right below this code.

     if ( ! empty( $title_link ) ) {
                                $output .= "<a href='{$title_link}' title='" . esc_attr( strip_tags( $title ) ) . "'>" . $title . "</a>";
                            } else {
                                $output .= $title;
                            }

    Best regards,
    Ismael

    #1372251

    Thanks

    Can this be added to my child theme to avoid any issues when updating the theme?

    #1372378

    Hi,
    You can add this function to your child theme functions.php:

    function avia_include_shortcode_template( $paths )
    {
    	if( ! is_array( $paths ) )
    	{
    		$paths = array();
    	}
    	
    	$template_url = get_stylesheet_directory();
    	array_unshift( $paths, $template_url . '/shortcodes/' );
    
    	return $paths;
    }
    
    add_filter( 'avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1 );

    then in your child theme directory create a new directory /shortcodes/ then copy the folder with your customized element into it, in your case /portfolio/portfolio.php

    Best regards,
    Mike

    #1372455

    Hi,
    I followed your instructions (adding to the child theme) but nothing is showing up on the front end.

    Thanks

    #1372458

    Hi,
    Did the solution work when you edited the /portfolio/portfolio.php file as Ismael suggested?
    Please try it that way to ensure his solution works.

    Best regards,
    Mike

    #1372460

    Hi Mike,

    That did not work. That broke the page somewhat

    Screenshot (after inserting Ismael code in themes/enfold/config-templatebuilder/avia-shortcodes/portfolio/portfolio.php ) – https://ibb.co/gVWFqnt

    I went ahead and remove the code

    Thanks

    #1372477

    Hi!

    Thanks for the update.

    We corrected the above modification for the portfolio.php file. Please try it again. https://kriesi.at/support/topic/show-portfolio-categories-2/#post-1372024

    Cheers!
    Ismael

    #1372864

    Hi guys

    This is still not working on either on the main enfold theme or enfold child.

    Would you mind taking a look again?

    #1373045

    Hi,

    Looks like you are trying to override the portfolio.php file in your child theme, but the current folder structure is incorrect. Please rename the config-templatebuilder folder to shortcodes and move the content of the avia-shortcodes folder one directory up inside the shortcodes folder or move the portfolio folder outside the avia-shortcodes folder, then delete the avia-shortcodes folder because it is no longer necessary. The modification should work after correcting the folder structure. If not, try to implement it directly in the parent theme template.

    Thank you for your patience.

    Best regards,
    Ismael

    • This reply was modified 2 years ago by Ismael.
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.