cipher87

Breadcrumb Separator

Apr 14th, 2021
702
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Change Breadcrumb Separator from / to >
  3.  * @link https://kriesi.at/support/topic/issues-with-breadcrumbs/#post-1294140
  4.  */
  5. function avia_title($args = false, $id = false)
  6. {
  7.     global $avia_config;
  8.  
  9.     if(!$id) $id = avia_get_the_id();
  10.    
  11.     $header_settings = avia_header_setting();
  12.     if($header_settings['header_title_bar'] == 'hidden_title_bar') return "";
  13.    
  14.     $defaults    = array(
  15.  
  16.         'title'         => get_the_title($id),
  17.         'subtitle'      => "", //avia_post_meta($id, 'subtitle'),
  18.         'link'          => get_permalink($id),
  19.         'html'          => "<div class='{class} title_container'><div class='container'>{heading_html}{additions}</div></div>",
  20.         'heading_html'  => "<{heading} class='main-title entry-title {heading_class}'>{title}</{heading}>",
  21.         'class'         => 'stretch_full container_wrap alternate_color '.avia_is_dark_bg('alternate_color', true),
  22.         'breadcrumb'    => true,
  23.         'additions'     => "",
  24.         'heading'       => 'h1', //headings are set based on this article: http://yoast.com/blog-headings-structure/
  25.         'heading_class' => ''
  26.     );
  27.  
  28.     if ( is_tax() || is_category() || is_tag() )
  29.     {
  30.         global $wp_query;
  31.  
  32.         $term = $wp_query->get_queried_object();
  33.         $defaults['link'] = get_term_link( $term );
  34.     }
  35.     else if(is_archive())
  36.     {
  37.         $defaults['link'] = "";
  38.     }
  39.    
  40.    
  41.     // Parse incomming $args into an array and merge it with $defaults
  42.     $args = wp_parse_args( $args, $defaults );
  43.    
  44.     /**
  45.      * @used_by     config-woocommerce\config.php avia_title_args_woopage()             10
  46.      * @since < 4.0
  47.      * @return array
  48.      */
  49.     $args = apply_filters( 'avf_title_args', $args, $id );
  50.  
  51.     //disable breadcrumb if requested
  52.     if($header_settings['header_title_bar'] == 'title_bar') $args['breadcrumb'] = false;
  53.    
  54.     //disable title if requested
  55.     if($header_settings['header_title_bar'] == 'breadcrumbs_only') $args['title'] = '';
  56.  
  57.  
  58.     // OPTIONAL: Declare each item in $args as its own variable i.e. $type, $before.
  59.     extract( $args, EXTR_SKIP );
  60.  
  61.     if(empty($title)) $class .= " empty_title ";
  62.     $markup = avia_markup_helper(array('context' => 'avia_title','echo'=>false));
  63.     if(!empty($link) && !empty($title)) $title = "<a href='".$link."' rel='bookmark' title='".__('Permanent Link:','avia_framework')." ".esc_attr( $title )."' $markup>".$title."</a>";
  64.     if(!empty($subtitle)) $additions .= "<div class='title_meta meta-color'>".wpautop($subtitle)."</div>";
  65.     if($breadcrumb) $additions .= avia_breadcrumbs(array('separator' => '>', 'richsnippet' => true)); // changed
  66.  
  67.  
  68.     if(!$title) $heading_html = "";
  69.     $html = str_replace('{heading_html}', $heading_html, $html);
  70.    
  71.    
  72.     $html = str_replace( '{class}', $class, $html );
  73.     $html = str_replace( '{title}', $title, $html );
  74.     $html = str_replace( '{additions}', $additions, $html );
  75.     $html = str_replace( '{heading}', $heading, $html );
  76.     $html = str_replace( '{heading_class}', $heading_class, $html );
  77.  
  78.     if(!empty($avia_config['slide_output']) && !avia_is_dynamic_template($id) && !avia_is_overview())
  79.     {
  80.         $avia_config['small_title'] = $title;
  81.     }
  82.     else
  83.     {
  84.         return $html;
  85.     }
  86. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×