/** * Outputs correct schema HTML for sections of the site * * @since 3.0.0 */ function wpex_schema_markup($location) { echo wpex_sanitize_data(wpex_get_schema_markup($location), 'html'); }
// Exit if accessed directly if (!defined('ABSPATH')) { exit; } // Get the title $title = wpex_title(); // Return if there isn't a title if (!$title) { return; } // Alter the heading for single blog posts and product posts to a span if (is_singular('post') && 'custom_text' == wpex_get_mod('blog_single_header', 'custom_text') || is_singular('product')) { $tag = 'span'; $schema_markup = null; } else { $tag = 'h1'; $schema_markup = wpex_get_schema_markup('headline'); } // Remove schema for other post types if (!in_array(get_post_type(), wpex_theme_post_types())) { $schema_markup = null; } $additionalClasses = ''; $portCat = get_the_terms(get_the_ID(), 'portfolio_category'); //echo print_r($portCat); //echo $portCat[0]->name; if (!empty($portCat)) { $additionalClasses = $portCat[0]->slug; } // Display title echo '<' . $tag . ' class="page-header-title ' . $additionalClasses . '"' . $schema_markup . '>' . $title . '</' . $tag . '>';
<?php /** * Returns the post title * * @package Total WordPress theme * @subpackage Partials * @version 3.3.0 */ // Exit if accessed directly if (!defined('ABSPATH')) { exit; } // Define title args $args = array(); // Single post markup if (is_singular('post') && 'custom_text' == wpex_get_mod('blog_single_header', 'custom_text')) { $args['html_tag'] = 'span'; $args['schema_markup'] = ''; } elseif (is_singular() && (!is_singular('page') && !is_singular('attachment'))) { $args['html_tag'] = 'span'; $args['schema_markup'] = ''; } // Apply filters $args = apply_filters('wpex_page_header_title_args', $args); // Parse args to prevent empty attributes and extract extract(wp_parse_args($args, array('html_tag' => 'h1', 'string' => wpex_title(), 'schema_markup' => wpex_get_schema_markup('headline')))); // Display title if (!empty($string)) { echo '<' . strip_tags($html_tag) . ' class="page-header-title wpex-clr"' . $schema_markup . '>' . wpex_sanitize_data($string, 'html') . '</' . strip_tags($html_tag) . '>'; }
/** * Outputs correct schema HTML for sections of the site * * @since 3.0.0 */ function wpex_schema_markup($location) { echo wpex_get_schema_markup($location); }
/** * Add schema markup to the authors post link * * @since 3.0.0 */ public static function the_author_posts_link($link) { // Add schema markup $schema = wpex_get_schema_markup('author_link'); if ($schema) { $link = str_replace('rel="author"', 'rel="author"' . $schema, $link); } // Return link return $link; }