Example #1
0
<?php

// Hide featured title area
if (!constructent_show_featured_title()) {
    return;
}
if (is_front_page() && !is_home()) {
    return;
}
$title = esc_html__('Archives', 'constructent');
$subtitle = '';
if (is_home()) {
    if ('posts' == get_option('show_on_front')) {
        $title = esc_html__('Home', 'constructent');
    } else {
        $page_for_posts = get_option('page_for_posts');
        $title = $page_for_posts ? get_the_title($page_for_posts) : esc_html__('Blog', 'constructent');
        $subtitle = constructent_meta('subtitle', '', $page_for_posts);
    }
} elseif (is_singular()) {
    if (!($title = constructent_meta('custom_title'))) {
        $title = get_the_title();
    }
    $subtitle = constructent_meta('subtitle');
} elseif (is_search()) {
    $title = sprintf(esc_html__('Search results for &quot;%s&quot;', 'constructent'), get_search_query());
} elseif (is_author()) {
    the_post();
    $title = sprintf(esc_html__('Author Archives: %s', 'constructent'), get_the_author());
    rewind_posts();
} elseif (is_day()) {
Example #2
0
/**
 * Add classes to <body>
 *
 * @param array $classes
 *
 * @return array
 */
function constructent_body_class($classes)
{
    // Layout class
    $classes[] = constructent_layout();
    // Class for layout style
    $classes[] = constructent_option('layout_style');
    // Color scheme
    $custom_color_scheme = constructent_option('custom_color_scheme');
    if (!$custom_color_scheme) {
        $classes[] = constructent_option('color_scheme');
    } else {
        $classes[] = 'custom-color-scheme';
    }
    // Class for custom header color
    if (constructent_option('header_custom') && constructent_option('header_background')) {
        $classes[] = 'header-custom';
    }
    // Class for woocommerce columns
    if (function_exists('is_shop') && (is_shop() || is_product_taxonomy())) {
        global $woocommerce_loop;
        if (empty($woocommerce_loop['columns'])) {
            $columns = 'full-content' == constructent_layout() ? 4 : 3;
        } else {
            $columns = $woocommerce_loop['columns'];
        }
        $classes[] = 'columns-' . esc_attr($columns);
    }
    // Class for solid header
    $header_type = constructent_option('header_type');
    $header_type = $header_type ? esc_attr($header_type) : 'static';
    if ($header_type == 'absolute' && !is_page_template('tpl/homepage.php')) {
        $classes[] = 'header-static';
    } else {
        $classes[] = 'header-' . $header_type;
    }
    // Transparent header
    if ('absolute' == $header_type && is_page_template('tpl/homepage.php') && constructent_option('header_transparent')) {
        $classes[] = 'header-transparent';
    }
    // Class for menu hover
    if ($hover = constructent_option('menu_hover')) {
        $classes[] = 'menu-hover-' . $hover;
    }
    // If no featured title area
    if (!constructent_show_featured_title()) {
        $classes[] = 'no-title-area';
    }
    // Class for portfolio layout
    if (is_page_template('tpl/portfolio.php')) {
        $classes[] = 'portfolio-' . constructent_meta('style_portfolio');
    }
    // Class for portfolio category layout
    if (is_tax('portfolio_category')) {
        $classes[] = 'portfolio-' . constructent_option('portfolio_view');
    }
    $classes = array_unique(array_filter($classes));
    return $classes;
}
Example #3
0
<?php

if (have_posts()) {
    the_post();
    ?>

	<article <?php 
    post_class('page-content');
    ?>
>
		<?php 
    if (!constructent_show_featured_title() && !is_front_page()) {
        ?>
			<header class="entry-header">
				<?php 
        the_title('<h1 class="page-title entry-title">', '</h1>');
        ?>
			</header>
		<?php 
    }
    ?>

		<div class="entry-content">
			<?php 
    the_content();
    ?>
			<?php 
    wp_link_pages(array('before' => '<p class="pages">' . esc_html__('Pages:', 'constructent'), 'after' => '</p>', 'link_before' => '<span>', 'link_after' => '</span>'));
    ?>
		</div>
	</article>