コード例 #1
0
<?php

/**
 * Returns the post title
 *
 * @package Total WordPress theme
 * @subpackage Partials
 * @version 3.0.0
 */
// 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;
}
コード例 #2
0
ファイル: vcex_heading.php プロジェクト: iq007/MadScape
 * @version 3.3.0
 */
// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}
// Not needed in admin ever
if (is_admin()) {
    return;
}
// Get and extract shortcode attributes
$atts = vc_map_get_attributes($this->getShortcode(), $atts);
extract($atts);
// Get text
if ('post_title' == $source) {
    $text = wpex_title();
    // Supports archives as well
} elseif ('custom_field' == $source) {
    $text = $custom_field ? get_post_meta(get_the_ID(), $custom_field, true) : '';
} else {
    $text = do_shortcode(htmlspecialchars_decode($text, ENT_COMPAT));
}
// Return if no heading
if (empty($text)) {
    return;
}
// Sanitize data
$tag = $tag ? $tag : 'div';
// Define vars
$wrap_classes = array('vcex-heading', 'reset-styles');
$link_html = array();
コード例 #3
0
ファイル: page-header-title.php プロジェクト: iq007/MadScape
<?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) . '>';
}