<main id="content" class="clr site-content" role="main"> <?php wpex_hook_content_top(); ?> <article class="entry clr"> <?php // Display custom text if (!empty(wpex_get_translated_theme_mod('error_page_text'))) { ?> <div class="custom-error404-content clr"> <?php echo apply_filters('the_content', wpex_get_translated_theme_mod('error_page_text')); ?> </div><!-- .custom-error404-content --> <?php // Display default text } else { ?> <div class="error404-content clr"> <h1><?php echo esc_html_x('You Broke The Internet!', '404 Page Header', 'total'); ?> </h1> <p><?php
/** * Gets correct heading for the related blog items * * @since 2.0.0 */ function wpex_portfolio_related_heading() { $heading = wpex_get_translated_theme_mod('portfolio_related_title'); $heading = $heading ? esc_html($heading) : esc_html__('Related Projects', 'total'); return $heading; }
/** * Returns correct title for WooCommerce pages. * * @since 2.0.0 */ public static function title_config($title) { // Shop title if (is_shop()) { $title = get_the_title(wc_get_page_id('shop')); $title = $title ? $title : ($title = esc_html__('Shop', 'total')); } elseif (is_product()) { $title = wpex_get_translated_theme_mod('woo_shop_single_title'); $title = $title ? $title : esc_html__('Shop', 'total'); } elseif (is_order_received_page()) { $title = esc_html__('Order Received', 'total'); } // Return title return $title; }
/** * Returns the correct title to display for any post/page/archive * * @package Total WordPress Theme * @subpackage Framework * @version 3.3.0 */ function wpex_title() { // Default title is null $title = NULL; // Get post ID from global object $post_id = wpex_global_obj('post_id'); // Homepage - display blog description if not a static page if (is_front_page() && !is_singular('page')) { if (get_bloginfo('description')) { $title = get_bloginfo('description'); } else { return esc_html__('Recent Posts', 'total'); } // Homepage posts page } elseif (is_home() && !is_singular('page')) { $title = get_the_title(get_option('page_for_posts', true)); } elseif (is_search()) { global $wp_query; $title = '<span id="search-results-count">' . $wp_query->found_posts . '</span> ' . esc_html__('Search Results Found', 'total'); } elseif (is_archive()) { // Author if (is_author()) { /*$title = sprintf( esc_html__( 'All posts by%s', 'total' ),': <span class="vcard">' . get_the_author() . '</span>' );*/ $title = get_the_archive_title(); } elseif (is_post_type_archive()) { $title = post_type_archive_title('', false); } elseif (is_day()) { $title = sprintf(esc_html__('Daily Archives: %s', 'total'), get_the_date()); } elseif (is_month()) { $title = sprintf(esc_html__('Monthly Archives: %s', 'total'), get_the_date(esc_html_x('F Y', 'Page title monthly archives date format', 'total'))); } elseif (is_year()) { $title = sprintf(esc_html__('Yearly Archives: %s', 'total'), get_the_date(esc_html_x('Y', 'Page title yearly archives date format', 'total'))); } else { // Get term title $title = single_term_title('', false); // Fix for bbPress and other plugins that are archives but use pages if (!$title) { global $post; $title = get_the_title($post_id); } } } elseif (is_404()) { $title = wpex_get_translated_theme_mod('error_page_title'); $title = $title ? $title : esc_html__('404: Page Not Found', 'total'); } elseif ($post_id) { // Single Pages if (is_singular('page') || is_singular('attachment')) { $title = get_the_title($post_id); } elseif (is_singular('post')) { $display = wpex_get_mod('blog_single_header'); $display = $display ? $display : 'custom_text'; if ('custom_text' == $display) { $title = wpex_get_mod('blog_single_header_custom_text'); $title = $title ? $title : esc_html__('Blog', 'total'); } elseif ('first_category' == $display) { $title = wpex_get_first_term_name(); } else { $title = get_the_title($post_id); } } else { $obj = get_post_type_object(get_post_type()); if (is_object($obj)) { $title = $obj->labels->name; } } } // Last check if title is empty $title = $title ? $title : get_the_title(); // Apply filters and return title return apply_filters('wpex_title', $title); }
/** * Returns testimonials singular name * * @since 3.3.0 */ function wpex_get_testimonials_singular_name() { $name = wpex_get_translated_theme_mod('testimonials_singular_name'); $name = $name ? esc_html($name) : esc_html__('Testimonial', 'total'); return $name; }
/** * Adds js for the retina logo * * @since 1.1.0 */ function wpex_retina_logo() { // Get theme options $logo_url = wpex_get_translated_theme_mod('retina_logo'); $logo_height = wpex_get_translated_theme_mod('logo_height'); // Header overlay Retina logo if (wpex_header_overlay_logo() && wpex_global_obj('has_overlay_header')) { $post_id = wpex_global_obj('post_id'); $overlay_retina_logo = get_post_meta($post_id, 'wpex_overlay_header_logo_retina', true); $overlay_retina_logo_height = get_post_meta($post_id, 'wpex_overlay_header_logo_retina_height', true); if ($overlay_retina_logo) { if (is_numeric($overlay_retina_logo)) { $overlay_retina_logo = wp_get_attachment_image_src($overlay_retina_logo, 'full'); $overlay_retina_logo = $overlay_retina_logo[0]; } else { $overlay_retina_logo = esc_url($overlay_retina_logo); } if ($overlay_retina_logo) { $logo_url = $overlay_retina_logo; $logo_height = $overlay_retina_logo_height ? $overlay_retina_logo_height : $logo_height; } } } // Apply filters $logo_url = apply_filters('wpex_retina_logo_url', $logo_url); $logo_height = apply_filters('wpex_retina_logo_height', $logo_height); // Output JS for retina logo if ($logo_url && $logo_height) { echo '<!-- Retina Logo --> <script type="text/javascript"> var $wpexRetinaLogo = "' . $logo_url . '", $wpexRetinaLogoHeight = "' . intval($logo_height) . '"; jQuery(function($){ if ( window.devicePixelRatio >= 2 ) { $("#site-logo img").attr("src", "' . $logo_url . '"); $("#site-logo img").css("max-height", "' . intval($logo_height) . 'px"); } }); </script>'; } }
private function generate_crumbs() { // Globals global $wp_query, $wp_rewrite; // Get post id $post_id = $this->post_id; // Define main variables $breadcrumb = $path = ''; $trail = array(); $item_type_scope = $this->itemscope; // Home text $home_text = wpex_get_translated_theme_mod('breadcrumbs_home_title'); $home_text = $home_text ? $home_text : '<span class="fa fa-home"></span><span class="display-none">' . esc_html_x('Home', 'breadcrumbs', 'total') . '</span>'; // Default arguments $args = apply_filters('wpex_breadcrumbs_args', array('home_text' => $home_text, 'home_link' => home_url('/'), 'separator' => wpex_element('angle_right'), 'front_page' => false, 'show_posts_page' => true)); // Extract args for easy variable naming. extract($args); /*-----------------------------------------------------------------------------------*/ /* - Homepage link /*-----------------------------------------------------------------------------------*/ $trail['trail_start'] = '<span ' . esc_attr($item_type_scope) . '><a href="' . esc_url($home_link) . '" title="' . esc_attr(get_bloginfo('name')) . '" rel="home" class="trail-begin" itemprop="url"><span itemprop="title">' . $home_text . '</span></a></span>'; /*-----------------------------------------------------------------------------------*/ /* - Front Page /*-----------------------------------------------------------------------------------*/ if (is_front_page()) { if (!$front_page) { $trail = false; } elseif ($show_home) { $trail['trail_end'] = "{$show_home}"; } } elseif (is_home()) { $home_page = get_page($wp_query->get_queried_object_id()); if (is_object($home_page)) { $trail = array_merge($trail, $this->get_post_parents($home_page->post_parent, '')); $trail['trail_end'] = '<span itemprop="title">' . get_the_title($home_page->ID) . '</span>'; } } elseif (is_singular()) { // Get singular vars $post = $wp_query->get_queried_object(); $post_id = absint($wp_query->get_queried_object_id()); $post_type = $post->post_type; $parent = $post->post_parent; // Pages if ('page' == $post_type) { // Woo pages if (WPEX_WOOCOMMERCE_ACTIVE) { // Add shop page to cart if (is_cart() || is_checkout()) { // Get shop data $shop_data = $this->get_shop_data(); $shop_url = $shop_data['url']; $shop_title = $shop_data['title']; // Add shop link if ($shop_url && $shop_title) { $trail['shop'] = '<span ' . esc_attr($item_type_scope) . ' class="trail-shop"><a href="' . esc_url($shop_url) . '" title="' . esc_attr($shop_title) . '" itemprop="url"><span itemprop="title">' . esc_html($shop_title) . '</span></a></span>'; } } // Add cart to checkout if (is_checkout()) { $cart_id = wpex_parse_obj_id(wc_get_page_id('cart'), 'page'); if ($cart_id) { $cart_title = get_the_title($cart_id); $trail['cart'] = '<span ' . esc_attr($item_type_scope) . ' class="trail-type-archive trail-cart"><a href="' . esc_url(get_permalink($cart_id)) . '" title="' . esc_attr($cart_title) . '" itemprop="url"><span itemprop="title">' . $cart_title . '</span></a></span>'; } } } } elseif ('post' == $post_type) { // Main Blog URL $page_id = wpex_parse_obj_id(wpex_get_mod('blog_page'), 'page'); if ($page_id) { $page_permalink = get_permalink($page_id); $page_name = get_the_title($page_id); if ($page_permalink && $page_name) { $trail['blog'] = '<span ' . esc_attr($item_type_scope) . ' class="trail-blog-url"> <a href="' . esc_url($page_permalink) . '" title="' . esc_attr($page_name) . '" itemprop="url"><span itemprop="title">' . $page_name . '</span></a></span>'; } } // Categories if ($terms = $this->get_post_terms($taxonomy = 'category')) { $trail['categories'] = '<span class="trail-post-categories">' . $terms . '</span>'; } } elseif ('tribe_events' == $post_type) { if (function_exists('tribe_get_events_link')) { $trail['tribe_events'] = '<span ' . esc_attr($item_type_scope) . ' class="trail-all-events"><a href="' . esc_url(tribe_get_events_link()) . '" title="' . esc_attr__('All Events', 'total') . '" itemprop="url"><span itemprop="title">' . esc_html__('All Events', 'total') . '</span></a></span>'; } } elseif ('portfolio' == $post_type) { // Portfolio main page $page_id = wpex_parse_obj_id(wpex_get_mod('portfolio_page'), 'page'); if ($page_id) { $page_permalink = get_permalink($page_id); $page_name = get_the_title($page_id); if ($page_permalink && $page_name) { $trail['portfolio'] = '<span ' . esc_attr($item_type_scope) . ' class="trail-portfolio-url"> <a href="' . esc_url($page_permalink) . '" title="' . esc_attr($page_name) . '" itemprop="url"><span itemprop="title">' . $page_name . '</span></a></span>'; } } // Portfolio Categories if ($terms = $this->get_post_terms($taxonomy = 'portfolio_category')) { $trail['categories'] = '<span class="trail-post-categories">' . $terms . '</span>'; } } elseif ('staff' == $post_type) { // Staff main page $page_id = wpex_parse_obj_id(wpex_get_mod('staff_page'), 'page'); if ($page_id) { $page_permalink = get_permalink($page_id); $page_name = get_the_title($page_id); if ($page_permalink && $page_name) { $trail['staff'] = '<span ' . esc_attr($item_type_scope) . ' class="trail-staff-url"> <a href="' . esc_url($page_permalink) . '" title="' . esc_attr($page_name) . '" itemprop="url"><span itemprop="title">' . $page_name . '</span></a></span>'; } } // Staff Categories if ($terms = $this->get_post_terms($taxonomy = 'staff_category')) { $trail['categories'] = '<span class="trail-post-categories">' . $terms . '</span>'; } } elseif ('testimonials' == $post_type) { // Testimonials main page $page_id = wpex_parse_obj_id(wpex_get_mod('testimonials_page'), 'page'); if ($page_id) { $page_permalink = get_permalink($page_id); $page_name = get_the_title($page_id); if ($page_permalink && $page_name) { $trail['testimonials'] = '<span ' . esc_attr($item_type_scope) . ' class="trail-testimonials-url"> <a href="' . esc_url($page_permalink) . '" title="' . esc_attr($page_name) . '" itemprop="url"><span itemprop="title">' . $page_name . '</span></a></span>'; } } // Testimonials Categories if ($terms = $this->get_post_terms($taxonomy = 'testimonials_category')) { $trail['categories'] = '<span class="trail-post-categories">' . $terms . '</span>'; } } elseif ('product' == $post_type) { // Get shop data $shop_data = $this->get_shop_data(); $shop_url = $shop_data['url']; $shop_title = $shop_data['title']; // Add shop page to product post if ($shop_url && $shop_title) { $trail['shop'] = '<span ' . esc_attr($item_type_scope) . '><a href="' . esc_url($shop_url) . '" title="' . esc_attr($shop_title) . '" itemprop="url"><span itemprop="title">' . $shop_title . '</span></a></span>'; } // Add categories to product post if ($terms = $this->get_post_terms($taxonomy = 'product_cat')) { $trail['categories'] = '<span class="trail-post-categories">' . $terms . '</span>'; } // Add cart to product post if (apply_filters('wpex_breadcrumbs_single_product_cart', false)) { $cart_id = wpex_parse_obj_id(wc_get_page_id('cart')); if ($cart_id) { $cart_title = get_the_title($cart_id); $trail['cart'] = '<span ' . esc_attr($item_type_scope) . '><a href="' . esc_url(get_permalink($cart_id)) . '" title="' . esc_attr($cart_title) . '" itemprop="url"><span itemprop="title">' . $cart_title . '</span></a></span>'; } } } else { $post_type_object = get_post_type_object($post_type); // Add $front to the path if ('post' == $post_type || $post_type_object->rewrite['with_front'] && $wp_rewrite->front) { $path .= trailingslashit($wp_rewrite->front); } // Add slug to $path if (!empty($post_type_object->rewrite['slug'])) { $path .= $post_type_object->rewrite['slug']; } // If archive page exists add to trail if (!empty($post_type_object->has_archive) && !is_singular('product')) { $trail['post_type_archive'] = '<span ' . esc_attr($item_type_scope) . ' class="trail-type-archive"><a href="' . esc_url(get_post_type_archive_link($post_type)) . '" title="' . esc_attr($post_type_object->labels->name) . '" itemprop="url"><span itemprop="title">' . $post_type_object->labels->name . '</span></a></span>'; } else { // If $path exists check for parents if (!empty($path)) { $trail = array_merge($trail, $this->get_post_parents('', $path)); } } } // If the post type path returns nothing and there is a parent, get its parents. if (empty($path) && $parent && 'attachment' != $post_type) { $trail = array_merge($trail, $this->get_post_parents($parent)); } // End trail with post title if ($post_title = get_the_title($post_id)) { if ($trim_title = wpex_get_mod('breadcrumbs_title_trim')) { $post_title = wp_trim_words($post_title, $trim_title); } $trail['trail_end'] = $post_title; } } elseif (is_archive()) { /*-----------------------------------------------------------------------------------*/ /* - Post Type Archive /*-----------------------------------------------------------------------------------*/ if (is_post_type_archive()) { // Shop Archive if (function_exists('is_shop') && is_shop()) { global $woocommerce; if (sizeof($woocommerce->cart->cart_contents) > 0) { $cart_id = wc_get_page_id('cart'); if (function_exists('icl_object_id')) { $cart_id = icl_object_id($cart_id, 'page'); } $cart_title = get_the_title($cart_id); if ($cart_id) { $trail['cart'] = '<span ' . esc_attr($item_type_scope) . ' class="trail-type-archive"><a href="' . esc_url(get_permalink($cart_id)) . '" title="' . esc_attr($cart_title) . '" itemprop="url"><span itemprop="title">' . $cart_title . '</span></a></span>'; } } // Get shop page $shop_data = $this->get_shop_data(); // Add shop page title to trail end if ($shop_data['title']) { $trail['trail_end'] = $shop_data['title']; } } elseif (is_post_type_archive('topic')) { $forums_link = get_post_type_archive_link('forum'); $forum_obj = get_post_type_object('forum'); $forum_name = $forum_obj->labels->name; if ($forums_link) { $trail['topics'] = '<span ' . esc_attr($item_type_scope) . '><a href="' . esc_url($forums_link) . '" title="' . esc_attr($forum_name) . '" itemprop="url">' . esc_html($forum_name) . '</a></span>'; } $trail['trail_end'] = $post_type_object->labels->name; // All other post type archives } else { // Get post type object $post_type_object = get_post_type_object(get_query_var('post_type')); // Add $front to $path if ($post_type_object->rewrite['with_front'] && $wp_rewrite->front) { $path .= trailingslashit($wp_rewrite->front); } // Add slug to $path if (!empty($post_type_object->rewrite['archive'])) { $path .= $post_type_object->rewrite['archive']; } // If patch exists check for parents if (!empty($path)) { $trail = array_merge($trail, $this->get_post_parents('', $path)); } // Add post type name to trail end $trail['trail_end'] = $post_type_object->labels->name; } } elseif (!is_search() && (is_tax() || is_category() || is_tag())) { // Get some taxonomy variables $term = $wp_query->get_queried_object(); $taxonomy = get_taxonomy($term->taxonomy); // Link to main portfolio page if (function_exists('wpex_is_portfolio_tax') && wpex_is_portfolio_tax() && ($portfolio_page = wpex_get_mod('portfolio_page'))) { $portfolio_url = get_permalink($portfolio_page); $portfolio_name = get_the_title($portfolio_page); if (function_exists('icl_object_id')) { $portfolio_page = icl_object_id($portfolio_page, 'page'); $portfolio_url = get_permalink($portfolio_page); $portfolio_name = get_the_title($portfolio_page); } if ($portfolio_url) { $trail['portfolio'] = '<span ' . esc_attr($item_type_scope) . ' class="trail-portfolio-url"><a href="' . esc_url($portfolio_url) . '" title="' . esc_attr($portfolio_name) . '" itemprop="url"><span itemprop="title">' . $portfolio_name . '</span></a></span>'; } } // Link to main staff page if (function_exists('wpex_is_staff_tax') && wpex_is_staff_tax() && ($staff_page = wpex_get_mod('staff_page'))) { if (function_exists('icl_object_id')) { $staff_page = icl_object_id($staff_page, 'page'); } $staff_url = get_permalink($staff_page); $staff_name = get_the_title($staff_page); if ($staff_url) { $trail['staff'] = '<span ' . esc_attr($item_type_scope) . ' class="trail-staff-url"><a href="' . esc_url($staff_url) . '" title="' . esc_attr($staff_name) . '" itemprop="url"><span itemprop="title">' . $staff_name . '</span></a></span>'; } } // Testimonials Tax if (function_exists('wpex_is_testimonials_tax') && wpex_is_testimonials_tax() && ($testimonials_page = wpex_get_mod('testimonials_page'))) { $testimonials_url = get_permalink($testimonials_page); $testimonials_name = get_the_title($testimonials_page); if (function_exists('icl_object_id')) { $testimonials_page = icl_object_id($testimonials_page, 'page'); $testimonials_url = get_permalink($testimonials_page); $testimonials_name = get_the_title($testimonials_page); } if ($testimonials_url) { $trail['testimonials'] = '<span ' . esc_attr($item_type_scope) . ' class="trail-testimonials-url"><a href="' . esc_url($testimonials_url) . '" title="' . esc_attr($testimonials_name) . '" itemprop="url"><span itemprop="title">' . $testimonials_name . '</span></a></span>'; } } // Woo Product Tax if (function_exists('wpex_is_woo_tax') && wpex_is_woo_tax()) { // Get shop data $shop_data = $this->get_shop_data(); $shop_url = $shop_data['url']; $shop_title = $shop_data['title']; // Add shop link if ($shop_url && $shop_title) { $trail['shop'] = '<span ' . esc_attr($item_type_scope) . ' class="trail-shop"><a href="' . esc_url($shop_url) . '" title="' . esc_attr($shop_title) . '" itemprop="url"><span itemprop="title">' . $shop_title . '</span></a></span>'; } } // Display main blog page on Categories & archives if (is_category() || is_tag()) { if ($blog_page = wpex_get_mod('blog_page')) { $blog_url = get_permalink($blog_page); $blog_name = get_the_title($blog_page); if (function_exists('icl_object_id')) { $blog_page = icl_object_id($blog_page, 'page'); $blog_url = get_permalink($blog_page); $blog_name = get_the_title($blog_page); } $trail['blog'] = '<span ' . esc_attr($item_type_scope) . ' class="trail-blog-url"><a href="' . esc_url($blog_url) . '" title="' . esc_attr($blog_name) . '" itemprop="url"><span itemprop="title">' . $blog_name . '</span></a></span>'; } } // Get the path to the term archive. Use this to determine if a page is present with it. if (is_category()) { $path = get_option('category_base'); } elseif (is_tag()) { $path = get_option('tag_base'); } else { if ($taxonomy->rewrite['with_front'] && $wp_rewrite->front) { $path = trailingslashit($wp_rewrite->front); } $path .= $taxonomy->rewrite['slug']; } // Get parent pages if they exist if ($path) { $trail = array_merge($trail, $this->get_post_parents('', $path)); } // Add term parents if (is_taxonomy_hierarchical($term->taxonomy) && $term->parent) { $trail = array_merge($trail, $this->get_term_parents($term)); } // Add term name to trail end $trail['trail_end'] = $term->name; } elseif (is_author()) { // If $front has been set, add it to $path. if (!empty($wp_rewrite->front)) { $path .= trailingslashit($wp_rewrite->front); } // If an $author_base exists, add it to $path. if (!empty($wp_rewrite->author_base)) { $path .= $wp_rewrite->author_base; } // If $path exists, check for parent pages. if (!empty($path)) { $trail = array_merge($trail, $this->get_post_parents('', $path)); } // Add the author's display name to the trail end. $trail['trail_end'] = get_the_author_meta('display_name', get_query_var('author')); } elseif (is_time()) { // Display minute and hour if (get_query_var('minute') && get_query_var('hour')) { $trail['trail_end'] = get_the_time('g:i a'); } elseif (get_query_var('minute')) { $trail['trail_end'] = sprintf(esc_html__('Minute %1$s', 'total'), get_the_time('i')); } elseif (get_query_var('hour')) { $trail['trail_end'] = get_the_time('g a'); } } elseif (is_date()) { // If $front is set check for parents if ($wp_rewrite->front) { $trail = array_merge($trail, $this->get_post_parents('', $wp_rewrite->front)); } // Day archive if (is_day()) { // Display year $title = date_i18n('Y', strtotime(get_the_time('Y'))); $trail['year'] = '<a href="' . esc_url(get_year_link(get_the_time('Y'))) . '" title="' . esc_attr($title) . '" itemprop="url">' . esc_html($title) . '</a>'; // Display month $title = date_i18n('F', strtotime(get_the_time('F'))); $trail['month'] = '<a href="' . esc_url(get_month_link(get_the_time('Y'), get_the_time('m'))) . '" title="' . esc_attr($title) . '" itemprop="url">' . esc_html($title) . '</a>'; // Display Time $trail['trail_end'] = date_i18n('j', strtotime(get_the_time('j'))); } elseif (get_query_var('w')) { // Display year $title = date_i18n('Y', strtotime(get_the_time('Y'))); $trail['year'] = '<a href="' . esc_url(get_year_link(get_the_time('Y'))) . '" title="' . esc_attr($title) . '" itemprop="url">' . esc_html($title) . '</a>'; // Display week $trail['trail_end'] = sprintf(esc_html__('Week %1$s', 'total'), get_the_time('W')); } elseif (is_month()) { $title = date_i18n('F', strtotime(get_the_time('F'))); $trail[] = '<a href="' . esc_url(get_year_link(get_the_time('Y'))) . '" title="' . esc_attr($title) . '" itemprop="url">' . esc_html($title) . '</a>'; $trail['trail_end'] = esc_html($title); } elseif (is_year()) { $trail['trail_end'] = date_i18n('Y', strtotime(get_the_time('Y'))); } } } elseif (is_search()) { $trail['trail_end'] = sprintf(esc_html__('Search results for "%1$s"', 'total'), esc_html(get_search_query())); } elseif (is_404()) { $trail['trail_end'] = wpex_get_mod('error_page_title') ? wpex_get_mod('error_page_title') : esc_html__('404 Not Found', 'total'); } elseif (function_exists('tribe_is_month') && tribe_is_month()) { $trail['trail_end'] = esc_html__('Events Calendar', 'total'); } /*-----------------------------------------------------------------------------------*/ /* - Create and return the breadcrumbs /*-----------------------------------------------------------------------------------*/ // Apply filters so developers can alter the trail $trail = apply_filters('wpex_breadcrumbs_trail', $trail); // Return trail if ($trail && is_array($trail)) { $classes = 'site-breadcrumbs wpex-clr'; $classes .= ' position-' . wpex_get_mod('breadcrumbs_position', 'default'); // Open Breadcrumbs $breadcrumb = '<nav class="' . $classes . '"><div class="breadcrumb-trail">'; // Separator HTML $separator = '<span class="sep"> ' . $separator . ' </span>'; // Join all trail items into a string $breadcrumb .= implode($separator, $trail); // Close breadcrumbs $breadcrumb .= '</div></nav>'; } // Update output var $this->output = $breadcrumb; }
* @version 3.3.0 */ // Exit if accessed directly if (!defined('ABSPATH')) { exit; } // Menu Location $menu_location = apply_filters('wpex_main_menu_location', 'main_menu'); // Multisite global menu $ms_global_menu = apply_filters('wpex_ms_global_menu', false); // Display if menu is defined if (has_nav_menu($menu_location) || $ms_global_menu) { // Get menu icon $icon = apply_filters('wpex_mobile_menu_navbar_open_icon', '<span class="fa fa-navicon"></span>'); // Get menu text $text = wpex_get_translated_theme_mod('mobile_menu_toggle_text'); $text = $text ? $text : esc_html_x('Menu', 'Mobile Menu Toggle Button Text', 'total'); $text = apply_filters('wpex_mobile_menu_navbar_open_text', $text); ?> <?php // Closing toggle for the sidr mobile menu style if ('sidr' == wpex_global_obj('mobile_menu_style')) { ?> <div id="sidr-close"><a href="#sidr-close" class="toggle-sidr-close"></a></div> <?php } ?>
/** * Returns topbar content * * @since 3.0.0 */ private function top_bar_social_alt() { // Get mod $content = wpex_get_translated_theme_mod('top_bar_social_alt'); // Check if social_alt is a page ID and get page content if (is_numeric($content)) { $post_id = $content; $post = get_post($post_id); if ($post && !is_wp_error($post)) { $content = $post->post_content; $this->vc_css_ids[$post_id] = $post_id; } } // Return content return $content; }
/** * Gets correct heading for the related blog items * * @since 2.0.0 */ function wpex_blog_related_heading() { $heading = wpex_get_translated_theme_mod('blog_related_title'); $heading = $heading ? $heading : esc_html__('Related Posts', 'total'); return $heading; }
if ($wpex_related_query->have_posts()) { // Wrap classes $wrap_classes = 'related-staff-posts clr'; if ('full-screen' == wpex_global_obj('post_layout')) { $wrap_classes .= ' container'; } ?> <section id="staff-single-related" class="<?php echo esc_attr($wrap_classes); ?> "> <?php // Get and translate heading text $heading = wpex_get_translated_theme_mod('staff_related_title'); $heading = $heading ? $heading : esc_html__('Related Staff', 'total'); // If Heading text isn't empty if ($heading) { ?> <?php // Display heading wpex_heading(array('content' => $heading, 'tag' => 'h2', 'classes' => array('related-staff-posts-heading'), 'apply_filters' => 'staff_related')); ?> <?php } ?> <div class="wpex-row wpex-clr"> <?php
<?php /** * Blog entry layout * * @package Total WordPress theme * @subpackage Partials * @version 3.3.0 */ // Exit if accessed directly if (!defined('ABSPATH')) { exit; } // Vars $format = get_post_format(); $text = wpex_get_translated_theme_mod('blog_entry_readmore_text'); $text = $text ? $text : esc_html__('Read More', 'total'); // Apply filters for child theming $text = apply_filters('wpex_post_readmore_link_text', $text); // Button classes $button_args = apply_filters('wpex_blog_entry_button_args', array('style' => '', 'color' => '')); ?> <div class="blog-entry-readmore clr"> <a href="<?php the_permalink(); ?> " class="<?php echo wpex_get_button_classes($button_args); ?> " title="<?php