'; if( $social_icon == 'googlePlus' ){ echo ''; }else{ echo ''; } echo ''; } } } } /** * Add a pingback url auto-discovery header for singularly identifiable articles. */ function agensy_pingback_header() { if ( is_singular() && pings_open() ) { echo ''; } } add_action( 'wp_head', 'agensy_pingback_header' ); /** *to display post in custom **/ function agensy_post_lists(){ $agensy_post_list = array( 'post_type' => 'post', 'posts_per_page' => -1, ); $posts_lists = array(); $posts_lists[''] = esc_html__('--Choose--','agensy'); $agensy_post = new WP_Query ($agensy_post_list); while( $agensy_post->have_posts() ): $agensy_post->the_post(); $posts_lists[ get_the_ID() ] = get_the_title(); endwhile; return $posts_lists; } /** *image display function * **/ function agensy_slider_control(){ ?>
'0', 'exclude' => '1', ) ); $agensy_services_cat_array = array(); $agensy_services_cat_array[''] = esc_html__('-- Choose --','agensy'); foreach($agensy_services_cat_lists as $agensy_services_cat_list){ $agensy_services_cat_array[$agensy_services_cat_list->slug] = $agensy_services_cat_list->name; } return $agensy_services_cat_array; } /** *adding breadcrumbs in header * **/ function agensy_breadcrumbs() { global $post; $body_classes = get_body_class(); $showOnHome = 0; // 1 - show breadcrumbs on the homepage, 0 - don't show $delimiter = '>'; $showCurrent = 1; // 1 - show current post/page title in breadcrumbs, 0 - don't show $homeLink = esc_url( home_url() ); if ( is_front_page()) { if ($showOnHome == 1) echo '
' . esc_html__('Home', 'agensy') . '
'; } else { echo '
' . esc_html__('Home', 'agensy') . ' ' . esc_attr($delimiter) . ' '; if (is_category()) { $thisCat = get_category(get_query_var('cat'), false); if ($thisCat->parent != 0) echo get_category_parents($thisCat->parent, TRUE, ' ' . esc_attr($delimiter) . ' '); echo ''. single_cat_title('', false).''; } if(is_home()) { single_post_title(); } elseif (is_search()) { echo '' . esc_html__('Search results for','agensy'). '"' . get_search_query() . '"' . ''; } elseif (is_day()) { echo '' . get_the_time('Y') . ' ' . esc_attr($delimiter) . ' '; echo '' . get_the_time('F') . ' ' . esc_attr($delimiter) . ' '; echo '' . get_the_time('d') . ''; } elseif (is_month()) { echo '' . get_the_time('Y') . ' ' . esc_attr($delimiter) . ' '; echo '' . get_the_time('F') . ''; } elseif (is_year()) { echo '' . get_the_time('Y') . ''; } elseif (is_single() && !is_attachment()) { if (get_post_type() != 'post') { if( get_post_type() == 'product' ){ $post_type = get_post_type_object(get_post_type()); $archiveLink = get_post_type_archive_link( 'product' ); $slug = $post_type->rewrite; echo '' . esc_attr($post_type->labels->singular_name) . ''; if ($showCurrent == 1) echo ' ' . esc_attr($delimiter) . ' ' . '' . get_the_title() . ''; }else{ $post_type = get_post_type_object(get_post_type()); $slug = $post_type->rewrite; echo '' . esc_attr($post_type->labels->singular_name) . ''; if ($showCurrent == 1) echo ' ' . esc_attr($delimiter) . ' ' . '' . get_the_title() . ''; } } else { $cat = get_the_category(); $cat = $cat[0]; $cats = get_category_parents($cat, TRUE, ' ' . $delimiter . ' '); if ($showCurrent == 0) $cats = preg_replace("#^(.+)\s$delimiter\s$#", "$1", $cats); echo agensy_sanitize_bradcrumb($cats); if ($showCurrent == 1) echo '' . get_the_title() . ''; } } elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) { $post_type = get_post_type_object(get_post_type()); echo '' . esc_attr($post_type->labels->singular_name) . ''; } elseif (is_attachment()) { if ($showCurrent == 1) echo ' ' . '' . get_the_title() . ''; } elseif (is_page() && !$post->post_parent) { if ($showCurrent == 1) echo '' . get_the_title() . ''; } elseif (is_page() && $post->post_parent) { $parent_id = $post->post_parent; $breadcrumbs = array(); while ($parent_id) { $page = get_page($parent_id); $breadcrumbs[] = '' . get_the_title($page->ID) . ''; $parent_id = $page->post_parent; } $breadcrumbs = array_reverse($breadcrumbs); for ($i = 0; $i < count($breadcrumbs); $i++) { echo agensy_sanitize_bradcrumb($breadcrumbs[$i]); if ($i != count($breadcrumbs) - 1) echo ' ' . esc_attr($delimiter). ' '; } if ($showCurrent == 1) echo ' ' . esc_attr($delimiter) . ' ' . '' . get_the_title() . ''; } elseif (is_tag()) { echo '' . esc_html__('Posts tagged','agensy').' "' . single_tag_title('', false) . '"' . ''; } elseif (is_author()) { global $author; $userdata = get_userdata($author); echo '' . esc_html__('Articles posted by ','agensy'). esc_attr($userdata->display_name) . ''; } elseif (is_404()) { echo '' . 'Error 404' . ''; } if (get_query_var('paged')) { if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) echo ' ('; esc_html_e('Page', 'agensy') . ' ' . get_query_var('paged'); if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) echo ')'; } echo '
'; } } /** * display breadcrumbs * */ function agensy_header_banner_x() { if( get_header_image() ){ $overlay = '
'; }else{ $overlay = '' ; } $agensy_breadcrumb_image_enable = get_theme_mod('agensy_breadcrumb_image_enable'); if( $agensy_breadcrumb_image_enable ){ ?>
', '' ); echo agensy_cat_title(); }elseif( is_home() ){ ?>

', ''); } elseif(is_search()) { ?>

' . get_search_query() . '' ); ?>

array( 'href'=>array() ) ); return wp_kses($input,$all_tags); } function agensy_cat_title(){ $archive_title = get_the_archive_title(); $explod = (explode(":",$archive_title)); $cat_name = end($explod); ?>

is_home() ) { $query->set('category__not_in', $ex_cats); } return $query; } add_filter('pre_get_posts', 'agensy_exclude_category_from_blogpost'); /** * Change comment form textarea to use placeholder * * @param array $args * @return array */ function agensy_comment_textarea_placeholder( $args ) { $args['comment_field'] = str_replace( 'textarea', 'textarea placeholder="Your Comment"', $args['comment_field'] ); return $args; } add_filter( 'comment_form_defaults', 'agensy_comment_textarea_placeholder' ); /** * Comment Form Fields Placeholder * */ function agensy_comment_form_fields( $fields ) { foreach( $fields as &$field ) { $field = str_replace( 'id="author"', 'id="author" placeholder="Your Name*"', $field ); $field = str_replace( 'id="email"', 'id="email" placeholder="Your Email Address*"', $field ); $field = str_replace( 'id="url"', 'id="url" placeholder="Your Website Address*"', $field ); } return $fields; } add_filter( 'comment_form_default_fields', 'agensy_comment_form_fields' ); /** * Post comment template */ function agensy_post_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • id="li-comment-">
    %s','agensy'), get_comment_author_link()); ?> comment_approved == '0') : ?>
    $depth, 'max_depth' => $args['max_depth']))) ?>