Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #207714

    I am trying to change the way the testimonial shortcode displays (created via page builder) to have the name and position on top of the actual testimonial.

    I could do this in the parent theme by modifying the output order in the /config-templatebuilder/avia-shortcoldes/testimonials.php file.

    My question is: what is the best, most WP friendly way to include this modification in the child theme so that it doesn’t revert back to default display on theme update?

    Do i need to re-create the /config-templatebuilder/avia-shortcodes structure or can i do it directly in child theme’s functions.php?

    The modified code looks like this:

    
    function av_testimonial_single($atts, $content = "", $shortcodename = "")
    			{
    				// ...
    
    	//final output
    				
    				$markup = avia_markup_helper(array('context' => 'person','echo'=>false));
    				
    				$output .= "<div class='avia-testimonial {$class}' $markup>";
    				$output .= "<div class='avia-testimonial_inner'>";
    	if($grid)   $output .= $avatar;
    				
    				$output .= 			"<div class='avia-testimonial-meta'><div class='avia-testimonial-arrow-wrap'><div class='avia-arrow'></div></div>";
    	if(!$grid)  $output .=  $avatar;
    				$output .= 				"<div class='avia-testimonial-meta-mini'>";
    	if($name)	$output .= 					"<strong  class='avia-testimonial-name'  {$markup_name}>{$name}";
    if($subtitle)	$output .= 					"<span class='avia-testimonial-subtitle'  {$markup_job}>{$subtitle}</span>";
        if($link)	$output .= 					"<span class='hidden avia-testimonial-markup-link'  {$markup_url}>{$link}</span>";
    	if($link)	$output .= 					" – {$linktext}";
    				$output .= 				"</div>";
    				$output .= 			"</div>";
    				$output .= 		"<div class='avia-testimonial-content' $markup_text>";
    				$output .= 		ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content));
    				$output .= 		"</div>";
    				$output .= "</div>";
    				$output .= "</div>";
    
    
    
    				if(avia_sc_testimonial::$counter == avia_sc_testimonial::$columns)
                    {
    				    $output .= "</section>";
    				}
    
    				avia_sc_testimonial::$counter++;
    				if(avia_sc_testimonial::$counter > avia_sc_testimonial::$columns) { avia_sc_testimonial::$counter = 1; avia_sc_testimonial::$rows++; }
    
    
    				return $output;
    			}
    
    #207843

    Hey Simon!

    Please refer to this link on how to override template builder’s shortcode function on a child theme: https://kriesi.at/support/topic/portfolio-meta/#post-134009

    Cheers!
    Ismael

    #207844

    Great thanks, i’ll look into that!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Modifying the output of shortcode in child theme’ is closed to new replies.