Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1313572

    Hello
    is there a way to replace the Category Names in Sortable Portfolio Grid on the frontend?
    I would like to give other names to the Portfolio Categories when they show up in front-end.
    Eg All / CAT 01 / CAT 02 / CAT 03/
    should show up as All / MY 01 / MY 02 / MY 03/
    Of course I cannot do it changing the category names in Portfolio Categories – it would be to easy :)
    Best Regards
    Manu

    #1314241

    Hey manurimini,

    Thank you for the inquiry.

    This is possible but you will have to modify the enfold/config-templatebuilder/avia-shortcodes/portfolio/portfolio.php directly. Around line 1219, you could add a switch statement, check for the $category->cat_name and replace it with something else.

    $output .= 	"<span class='text-sep " . $category->category_nicename . "_sort_sep'>/</span>";
    					$output .= 		'<a href="#" data-filter="' . $category->category_nicename . '_sort" class="' . $category->category_nicename . '_sort_button" ><span class="inner_sort_button">';
    					$output .= 			"<span>" . esc_html( trim( $category->cat_name ) ) . "</span>";
    					$output .= 			"<small class='av-cat-count'> " . $cat_count[ $category->term_id ] . " </small></span>";
    					$output .= 		'</a>';
    

    // https://www.w3schools.com/php/php_switch.asp

    This is where the category name is rendered.

    $output .= "<span>" . esc_html( trim( $category->cat_name ) ) . "</span>";
    

    It is also possible with Javascript.

    // https://www.w3schools.com/jsref/jsref_replace.asp

    Best regards,
    Ismael

    #1314428

    Hello Ismael
    I think this is a little bit too difficult for me. Is there a way to solve it with a function to put in functions.php that says something like: if the category name is CATX rename it with CATY?
    Thank you
    Best Regards
    Manu

    #1314783

    Hi,

    Is there a way to solve it with a function to put in functions.php that says something like: if the category name is CATX rename it with CATY?

    That is not possible, unfortunately, You will have to add the modifications in the shortcode file directly, or you have to use Javascript. If you chose to use a Javascript solution, you might find this helpful.

    // https://kriesi.at/support/topic/menu-position-on-header/#post-1312127
    // https://kriesi.at/support/topic/4-8-2-onwards-woocommerce-main-shop-image-is-being-lazy-loaded/#post-1313773

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.