Guest User

Untitled

a guest
Dec 11th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. /**
  2. * remove event breadcrumbs by yigit
  3. */
  4. function avia_title($args = false, $id = false)
  5. {
  6. global $avia_config;
  7.  
  8. if(!$id) $id = avia_get_the_id();
  9.  
  10. $header_settings = avia_header_setting();
  11. if($header_settings['header_title_bar'] == 'hidden_title_bar' || is_singular( 'tribe_events' )) return "";
  12.  
  13. $defaults = array(
  14.  
  15. 'title' => get_the_title($id),
  16. 'subtitle' => "", //avia_post_meta($id, 'subtitle'),
  17. 'link' => get_permalink($id),
  18. 'html' => "<div class='{class} title_container'><div class='container'><{heading} class='main-title entry-title'>{title}</{heading}>{additions}</div></div>",
  19. 'class' => 'stretch_full container_wrap alternate_color '.avia_is_dark_bg('alternate_color', true),
  20. 'breadcrumb' => true,
  21. 'additions' => "",
  22. 'heading' => 'h1' //headings are set based on this article: http://yoast.com/blog-headings-structure/
  23. );
  24.  
  25. if ( is_tax() || is_category() || is_tag() )
  26. {
  27. global $wp_query;
  28.  
  29. $term = $wp_query->get_queried_object();
  30. $defaults['link'] = get_term_link( $term );
  31. }
  32. else if(is_archive())
  33. {
  34. $defaults['link'] = "";
  35. }
  36.  
  37.  
  38. // Parse incomming $args into an array and merge it with $defaults
  39. $args = wp_parse_args( $args, $defaults );
  40. $args = apply_filters('avf_title_args', $args, $id);
  41.  
  42. //disable breadcrumb if requested
  43. if($header_settings['header_title_bar'] == 'title_bar') $args['breadcrumb'] = false;
  44.  
  45. //disable title if requested
  46. if($header_settings['header_title_bar'] == 'breadcrumbs_only') $args['title'] = '';
  47.  
  48.  
  49. // OPTIONAL: Declare each item in $args as its own variable i.e. $type, $before.
  50. extract( $args, EXTR_SKIP );
  51.  
  52. if(empty($title)) $class .= " empty_title ";
  53. $markup = avia_markup_helper(array('context' => 'avia_title','echo'=>false));
  54. if(!empty($link) && !empty($title)) $title = "".$title."";
  55. if(!empty($subtitle)) $additions .= "<div class='title_meta meta-color'>".wpautop($subtitle)."</div>";
  56. if($breadcrumb) $additions .= avia_breadcrumbs(array('separator' => '/', 'richsnippet' => true));
  57.  
  58.  
  59. $html = str_replace('{class}', $class, $html);
  60. $html = str_replace('{title}', $title, $html);
  61. $html = str_replace('{additions}', $additions, $html);
  62. $html = str_replace('{heading}', $heading, $html);
  63.  
  64.  
  65.  
  66. if(!empty($avia_config['slide_output']) && !avia_is_dynamic_template($id) && !avia_is_overview())
  67. {
  68. $avia_config['small_title'] = $title;
  69. }
  70. else
  71. {
  72. return $html;
  73. }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment