Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $class = '';
- $class2 = '';
- if (get_metabox("bg_dark") == "true") {
- $class2 = ' class="light"';
- } else if (get_metabox("bg_dark") != "false") {
- if (tw_option("title_bg_dark")) {
- $class2 = ' class="light"';
- }
- }
- if (is_singular('post') || is_home()) {
- $title = "<h1>" . apply_filters('widget_title', tw_option('blog_title')) . "</h1>";
- } elseif(is_singular('portfolio')){
- $title = "<h1>" . apply_filters('widget_title', tw_option('port_title')) . "</h1>";
- } elseif(is_category()){
- $title = "<h1>";
- $categories = get_the_category();
- $separator = ' ';
- $output = '';
- if ( ! empty( $categories ) ) {
- foreach( $categories as $category ) {
- $title .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" alt="' . esc_attr( sprintf( __( 'View all posts in %s', 'textdomain' ), $category->name ) ) . '">' . esc_html( $category->name ) . '</a>' . $separator;
- }
- echo trim( $output, $separator );
- }
- $title .= "</h1>";
- } else {
- if (is_page()) {
- $title = "<h1>" . get_featuredtext() . "</h1>";
- if (get_metabox("title_bg_image") != "") {
- $bgimage = get_metabox("title_bg_image");
- }
- if (get_metabox("title_prllx")) {
- $class = ' class="bg-parallax"';
- }
- } else {
- $title = "<h1>" . get_featuredtext() . "</h1>";
- }
- }
- $breadcrumb = $share = false;
- if (get_metabox("breadcrumps") == "true") {
- $breadcrumb = true;
- } else if (get_metabox("breadcrumps") != "false") {
- if (tw_option("breadcrumps")) {
- $breadcrumb = true;
- }
- }
- $ebreadcrumb = "";
- if ($breadcrumb) {
- ob_start();
- breadcrumbs();
- $ebreadcrumb = ob_get_clean();
- }
- if (woocommerce_enabled() && get_post_type() == 'product') {
- $shop_page_id = woocommerce_get_page_id('shop');
- $shop_metabox = get_post_meta($shop_page_id, 'themewaves_' . strtolower(THEMENAME) . '_options', true);
- if (!empty($shop_metabox["title_bg_image"])) {
- $bgimage = $shop_metabox["title_bg_image"];
- }
- ob_start();
- echo "<h1>";
- woocommerce_page_title();
- echo "</h1>";
- $title = ob_get_clean();
- if ($breadcrumb) {
- ob_start();
- woocommerce_breadcrumb();
- $ebreadcrumb = ob_get_clean();
- }
- }
- $background = isset($bgimage) ? $bgimage : tw_option('title_bg_image');
- $style1 = !empty($background) ? (' style="background-image: url(' . esc_url($background) . ')"') : '';
- if (isset($title)) {
- ?>
- <!-- Start Feature -->
- <section id="page-title"<?php echo $class . $class2 . $style1; ?>>
- <!-- Start Container -->
- <div class="container">
- <?php
- if ($breadcrumb) {
- echo balanceTags($title);
- echo '<div class="waves-breadcrumbs">';
- echo balanceTags($ebreadcrumb);
- echo '</div>';
- } else {
- echo balanceTags($title);
- }
- ?>
- </div>
- <!-- End Container -->
- </section>
- <!-- End Feature -->
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement