Exemplo n.º 1
0
function us_create_post_types()
{
    // Portfolio post type
    register_post_type('us_portfolio', array('labels' => array('name' => __('Portfolio Items', 'us'), 'singular_name' => __('Portfolio Item', 'us'), 'add_new' => __('Add Portfolio Item', 'us')), 'public' => TRUE, 'rewrite' => array('slug' => us_get_option('portfolio_slug', 'us_portfolio')), 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'comments'), 'can_export' => TRUE, 'capability_type' => 'us_portfolio', 'map_meta_cap' => TRUE));
    // Portfolio categories
    register_taxonomy('us_portfolio_category', array('us_portfolio'), array('hierarchical' => TRUE, 'label' => __('Portfolio Categories', 'us'), 'singular_label' => __('Portfolio Category', 'us'), 'rewrite' => TRUE));
    // Clients post type
    register_post_type('us_client', array('labels' => array('name' => __('Clients Logos', 'us'), 'singular_name' => __('Client Logo', 'us'), 'add_new' => __('Add Client Logo', 'us')), 'public' => FALSE, 'publicly_queryable' => FALSE, 'exclude_from_search' => FALSE, 'show_in_nav_menus' => FALSE, 'show_ui' => TRUE, 'has_archive' => FALSE, 'query_var' => FALSE, 'supports' => array('title', 'thumbnail'), 'can_export' => TRUE, 'capability_type' => 'us_client', 'map_meta_cap' => TRUE));
}
Exemplo n.º 2
0
 function us_themeforest_themes_update($updates)
 {
     global $us_template_directory;
     if (isset($updates->checked)) {
         require_once $us_template_directory . '/framework/vendor/tf-updater/pixelentity-themes-updater/class-pixelentity-themes-updater.php';
         $username = us_get_option('themeforest_username');
         $apikey = us_get_option('themeforest_api_key');
         $author = 'UpSolution';
         $updater = new Pixelentity_Themes_Updater($username, $apikey, $author);
         $updates = $updater->check($updates);
     }
     return $updates;
 }
Exemplo n.º 3
0
 public function init()
 {
     // Adding new shortcodes
     foreach ($this->config as $shortcode => $shortcode_params) {
         if (isset($shortcode_params['disabled']) and $shortcode_params['disabled']) {
             // If the shortcode is disabled, don't handle it at all
             if (!us_get_option('enable_unsupported_vc_shortcodes', FALSE) and shortcode_exists($shortcode)) {
                 remove_shortcode($shortcode);
             }
             continue;
         }
         // Taking over the previous declaration
         if (shortcode_exists($shortcode)) {
             remove_shortcode($shortcode);
         }
         add_shortcode($shortcode, array($this, $shortcode));
     }
     $this->inited = TRUE;
 }
Exemplo n.º 4
0
function us_custom_styles()
{
    global $us_template_directory_uri, $us_stylesheet_directory_uri;
    $theme_version = us_get_main_theme_version();
    if ($us_template_directory_uri != $us_stylesheet_directory_uri) {
        wp_register_style('theme-style', $us_stylesheet_directory_uri . '/style.css', array(), $theme_version, 'all');
        wp_enqueue_style('theme-style');
    }
    global $us_generate_css_file;
    $us_generate_css_file = us_get_option('generate_css_file', TRUE);
    if ($us_generate_css_file) {
        $wp_upload_dir = wp_upload_dir();
        $styles_dir = $wp_upload_dir['basedir'] . '/us-assets';
        $styles_dir = str_replace('\\', '/', $styles_dir);
        $styles_file = $styles_dir . '/theme-options.css';
        if (file_exists($styles_file)) {
            wp_enqueue_style('us-theme-options', str_replace(array('http:', 'https:'), '', $wp_upload_dir['baseurl']) . '/us-assets/theme-options.css', array(), $theme_version, 'all');
        } else {
            $us_generate_css_file = FALSE;
        }
    }
}
Exemplo n.º 5
0
function us_wc_body_class($classes)
{
    $classes[] = 'woocommerce-type_' . us_get_option('shop_listing_style', 1);
    if (is_single()) {
        $classes[] = 'columns-' . us_get_option('product_related_qty', 4);
    } else {
        $classes[] = 'columns-' . us_get_option('shop_columns', 4);
    }
    return $classes;
}
Exemplo n.º 6
0
/**
 * Get information about previous and next post or page (should be used in singular element context)
 *
 * @return array
 */
function us_get_post_prevnext()
{
    // TODO Create for singular pages https://codex.wordpress.org/Next_and_Previous_Links#The_Next_and_Previous_Pages
    $result = array();
    if (is_singular('us_portfolio')) {
        global $us_post_prevnext_exclude_ids;
        if ($us_post_prevnext_exclude_ids === NULL) {
            // Getting the list of portfolio items that are not supposed to have their own pages (external links or lightboxes)
            global $wpdb;
            $wpdb_query = 'SELECT `post_id` FROM `' . $wpdb->postmeta . '` ';
            $wpdb_query .= 'WHERE (`meta_key`=\'us_lightbox\' AND `meta_value`=\'1\') ';
            $wpdb_query .= 'OR (`meta_key`=\'us_custom_link\' AND `meta_value` != \'\')';
            $us_post_prevnext_exclude_ids = apply_filters('us_get_post_prevnext_exclude_ids', $wpdb->get_col($wpdb_query));
            if (!empty($us_post_prevnext_exclude_ids)) {
                add_filter('get_next_post_where', 'us_exclude_hidden_portfolios_from_prevnext');
                add_filter('get_previous_post_where', 'us_exclude_hidden_portfolios_from_prevnext');
            }
        }
        $in_same_term = !!us_get_option('portfolio_prevnext_category');
        $prev_post = get_next_post($in_same_term, '', 'us_portfolio_category');
        $next_post = get_previous_post($in_same_term, '', 'us_portfolio_category');
    } else {
        $prev_post = get_next_post(FALSE);
        $next_post = get_previous_post(FALSE);
    }
    if (!empty($prev_post)) {
        $result['prev'] = array('link' => get_permalink($prev_post->ID), 'title' => get_the_title($prev_post->ID), 'meta' => __('Previous post', 'us'));
    }
    if (!empty($next_post)) {
        $result['next'] = array('link' => get_permalink($next_post->ID), 'title' => get_the_title($next_post->ID), 'meta' => __('Next post', 'us'));
    }
    return $result;
}
Exemplo n.º 7
0
        if (filter_var($social_url, FILTER_VALIDATE_EMAIL)) {
            $social_url = 'mailto:' . $social_url;
        }
    } elseif ($social_key == 'skype') {
        // Skype link may be some http(s): or skype: link. If protocol is not set, adding "skype:"
        if (strpos($social_url, ':') === FALSE) {
            $social_url = 'skype:' . esc_attr($social_url);
        }
    } else {
        $social_url = esc_url($social_url);
    }
    $output .= '<div class="w-socials-item ' . $social_key . '">
		<a class="w-socials-item-link" target="_blank" href="' . $social_url . '"></a>
		<div class="w-socials-item-popup">
			<span>' . $social . '</span>
		</div>
	</div>';
}
// Custom icon
$custom_icon = us_get_option('header_socials_custom_icon');
$custom_link = us_get_option('header_socials_custom_url');
if (!empty($custom_icon) and !empty($custom_link)) {
    $output .= '<div class="w-socials-item custom">';
    $output .= '<a class="w-socials-item-link" target="_blank" href="' . esc_url($custom_link) . '">';
    $output .= '<i class="' . us_prepare_icon_class($custom_icon) . '"></i>';
    $output .= '</a></div>';
}
if (!empty($output)) {
    $output = '<div class="w-socials"><div class="w-socials-list">' . $output . '</div></div>';
}
echo $output;
Exemplo n.º 8
0
 function us_excerpt_length($length)
 {
     $excerpt_length = us_get_option('excerpt_length');
     if ($excerpt_length === NULL) {
         return $length;
     } elseif ($excerpt_length === '') {
         // If not set, showing the full excerpt
         return 9999;
     } else {
         return intval($excerpt_length);
     }
 }
Exemplo n.º 9
0
<?php

defined('ABSPATH') or die('This script cannot be accessed directly.');
/**
 * The template for displaying archive pages
 */
$us_layout = US_Layout::instance();
// Needed for canvas class
$us_layout->titlebar = 'default';
get_header();
// Creating .l-titlebar
us_load_template('templates/titlebar', array('title' => get_the_archive_title()));
$template_vars = array('layout_type' => us_get_option('archive_layout', 'large'), 'metas' => array(), 'content_type' => us_get_option('archive_content_type', 'excerpt'), 'show_read_more' => !!us_get_option('archive_read_more', TRUE), 'pagination' => us_get_option('archive_pagination', 'regular'));
foreach (array('date', 'author', 'categories', 'comments', 'tags') as $meta_key) {
    if (us_get_option('archive_meta_' . $meta_key, TRUE)) {
        $template_vars['metas'][] = $meta_key;
    }
}
?>
<!-- MAIN -->
<div class="l-main">
	<div class="l-main-h i-cf">

		<div class="l-content g-html">
			<section class="l-section">
				<div class="l-section-h i-cf">

					<?php 
do_action('us_before_archive');
?>
Exemplo n.º 10
0
 public function translate_vc_custom_heading(&$name, &$params)
 {
     if (!isset($params['google_fonts']) or empty($params['google_fonts'])) {
         $heading_font = us_get_option('heading_font_family');
         if (empty($heading_font)) {
             return FALSE;
         }
         $font_config = us_config('google-fonts.' . $heading_font);
         if (empty($font_config) or !is_array($font_config)) {
             return FALSE;
         }
         $vc_font_value = array('font_family' => array(), 'font_style' => rawurlencode('400 regular:400:normal'));
         foreach ($font_config['variants'] as $font_family) {
             if ($font_family == '400') {
                 $font_family = 'regular';
             } elseif ($font_family == '400italic') {
                 $font_family = 'italic';
             }
             $vc_font_value['font_family'][] = $font_family;
         }
         $vc_font_value['font_family'] = rawurlencode($heading_font . ':' . implode(',', $vc_font_value['font_family']));
         foreach (array(200, 300, 400, 600, 700) as $weight) {
             if (us_get_option('heading_font_weight_' . $weight)) {
                 $vc_font_value['font_style'] = rawurlencode($weight . ' regular:' . $weight . ':normal');
                 break;
             }
         }
         $params['google_fonts'] = 'font_family:' . $vc_font_value['font_family'] . '|font_style:' . $vc_font_value['font_style'];
         return TRUE;
     }
     return FALSE;
 }
Exemplo n.º 11
0
        echo $item['title'];
        ?>
</span>
					</a>
				<?php 
    }
    ?>
			</div>
		</div>
	</section>
<?php 
}
?>

<?php 
if (us_get_option('post_related', TRUE)) {
    ?>
	<?php 
    us_load_template('templates/blog/single-post-related');
}
?>

<?php 
if (comments_open() or get_comments_number() != '0') {
    ?>
	<section class="l-section for_comments">
		<div class="l-section-h i-cf">
			<?php 
    wp_enqueue_script('comment-reply');
    ?>
			<?php 
Exemplo n.º 12
0
<?php

$us_layout = US_Layout::instance();
if (is_singular()) {
    $us_layout->sidebar_pos = us_get_option('product_sidebar', 'right');
    if (rwmb_meta('us_sidebar') != '') {
        $us_layout->sidebar_pos = rwmb_meta('us_sidebar');
    }
} else {
    $us_layout->sidebar_pos = us_get_option('shop_sidebar', 'right');
}
$titlebar_content = us_get_option('shop_titlebar_content', 'all');
if (is_singular()) {
    if (rwmb_meta('us_titlebar_content') != '') {
        $titlebar_content = rwmb_meta('us_titlebar_content');
    }
}
$us_layout->titlebar = $titlebar_content == 'hide' ? 'none' : 'default';
get_header();
if ($titlebar_content != 'hide') {
    // Hiding the default WooCommerce page title to avoid duplication
    remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_title', 5);
    add_filter('woocommerce_show_page_title', 'us_woocommerce_dont_show_page_title');
    function us_woocommerce_dont_show_page_title()
    {
        return FALSE;
    }
    if ($titlebar_content == 'all') {
        // Hiding the default WooCommerce breadcrumbs to avoid duplication
        remove_action('woocommerce_single_product_summary', 'woocommerce_breadcrumb', 3);
    }
Exemplo n.º 13
0
}
if (!isset($show_breadcrumbs)) {
    $show_breadcrumbs = (!is_singular('us_portfolio') and $titlebar_content == 'all');
}
if (!isset($show_prevnext)) {
    $show_prevnext = (is_singular('us_portfolio') and $titlebar_content == 'all');
}
// No need to do other actions: titlebar will be hidden
if (!$show_title and !$show_breadcrumbs and !$show_prevnext) {
    return;
}
$classes = '';
$bg_img_atts = '';
// Theme-options defined settings
$size = us_get_option('titlebar_size', 'large');
$color_style = us_get_option('titlebar_color', 'alternate');
$bg_image = '';
if (is_singular()) {
    $meta_size = rwmb_meta('us_titlebar_size');
    if (!empty($meta_size)) {
        $size = $meta_size;
    }
    $meta_color_style = rwmb_meta('us_titlebar_color');
    if ($meta_color_style != '') {
        $color_style = $meta_color_style;
    }
    $bg_image = rwmb_meta('us_titlebar_image');
    if (!empty($bg_image)) {
        $bg_image_src = wp_get_attachment_image_src((int) $bg_image, 'full');
        if ($bg_image_src) {
            $bg_image = $bg_image_src[0];
Exemplo n.º 14
0
 function us_remove_vc_base_css_js()
 {
     global $us_template_directory_uri;
     if (wp_style_is('font-awesome', 'registered')) {
         wp_deregister_style('font-awesome');
     }
     if (!us_get_option('enable_unsupported_vc_shortcodes', FALSE)) {
         if (wp_style_is('js_composer_front', 'registered')) {
             wp_deregister_style('js_composer_front');
         }
         if (wp_script_is('wpb_composer_front_js', 'registered')) {
             wp_deregister_script('wpb_composer_front_js');
         }
         wp_enqueue_style('us-style-vc-icon', $us_template_directory_uri . '/framework/css/site/vc_icon.css', array(), us_get_main_theme_version(), 'all');
     }
 }
Exemplo n.º 15
0
				<?php 
        if (us_get_option('header_search_show') and $us_layout->header_layout == 'advanced') {
            ?>
					<?php 
            us_load_template('templates/widgets/search');
            ?>
				<?php 
        }
        ?>

				<?php 
        us_load_template('templates/widgets/nav-main');
        ?>

				<?php 
        if (us_get_option('header_search_show') and $us_layout->header_layout == 'centered') {
            ?>
					<?php 
            us_load_template('templates/widgets/search');
            ?>
				<?php 
        }
        ?>

				<?php 
        if ($us_layout->header_layout == 'centered') {
            ?>
					<?php 
            us_load_template('templates/widgets/cart');
            ?>
				<?php 
Exemplo n.º 16
0
;
	$us.canvasOptions.headerScrollBreakpoint = <?php 
echo intval(us_get_option('header_scroll_breakpoint', 100));
?>
;
	$us.canvasOptions.responsive = <?php 
echo us_get_option('responsive_layout', TRUE) ? 'true' : 'false';
?>
;

	$us.navOptions = ($us.navOptions || {});
	$us.navOptions.mobileWidth = <?php 
echo intval(us_get_option('menu_mobile_width', 900));
?>
;
	$us.navOptions.togglable = <?php 
echo us_get_option('menu_togglable_type', TRUE) ? 'true' : 'false';
?>
;
</script>
<?php 
echo us_get_option('custom_html', '');
?>

<?php 
wp_footer();
?>

</body>
</html>
Exemplo n.º 17
0
<?php

defined('ABSPATH') or die('This script cannot be accessed directly.');
/**
 * Index template (used for front page blog listing)
 */
$us_layout = US_Layout::instance();
get_header();
$template_vars = array('layout_type' => us_get_option('blog_layout', 'large'), 'metas' => array(), 'content_type' => us_get_option('blog_content_type', 'excerpt'), 'show_read_more' => !!us_get_option('blog_read_more', TRUE), 'pagination' => us_get_option('blog_pagination', 'regular'));
foreach (array('date', 'author', 'categories', 'comments', 'tags') as $meta_key) {
    if (us_get_option('blog_meta_' . $meta_key, TRUE)) {
        $template_vars['metas'][] = $meta_key;
    }
}
?>
<!-- MAIN -->
<div class="l-main">
	<div class="l-main-h i-cf">

		<div class="l-content g-html">
			<section class="l-section">
				<div class="l-section-h i-cf">

					<?php 
do_action('us_before_index');
?>

					<?php 
us_load_template('templates/blog/listing', $template_vars);
?>
Exemplo n.º 18
0
			<?php 
while (have_posts()) {
    the_post();
    $the_content = apply_filters('the_content', get_the_content());
    // The page may be paginated itself via <!--nextpage--> tags
    $pagination = us_wp_link_pages(array('before' => '<div class="w-blog-pagination"><nav class="navigation pagination" role="navigation">', 'after' => '</nav></div>', 'next_or_number' => 'next_and_number', 'nextpagelink' => '>', 'previouspagelink' => '<', 'link_before' => '<span>', 'link_after' => '</span>', 'echo' => 0));
    // If content has no sections, we'll create them manually
    $has_own_sections = strpos($the_content, ' class="l-section') !== FALSE;
    if (!$has_own_sections) {
        $the_content = '<section class="l-section"><div class="l-section-h i-cf">' . $the_content . $pagination . '</div></section>';
    } elseif (!empty($pagination)) {
        $the_content .= '<section class="l-section"><div class="l-section-h i-cf">' . $pagination . '</div></section>';
    }
    echo $the_content;
    // Post comments
    $show_comments = us_get_option('page_comments', FALSE);
    if ($show_comments and (comments_open() or get_comments_number() != '0')) {
        ?>
<section class="l-section for_comments">
						<div class="l-section-h i-cf"><?php 
        wp_enqueue_script('comment-reply');
        comments_template();
        ?>
</div>
					</section><?php 
    }
}
?>

			<?php 
do_action('us_after_page');
Exemplo n.º 19
0
		</div>
	<?php 
}
/* header email */
?>
	<?php 
if (us_get_option('header_contacts_custom_text')) {
    ?>
		<div class="w-contacts-item for_custom">
			<?php 
    if (us_get_option('header_contacts_custom_icon')) {
        ?>
<i class="<?php 
        echo us_prepare_icon_class(us_get_option('header_contacts_custom_icon'));
        ?>
"></i><?php 
    }
    ?>
			<span class="w-contacts-item-value"><?php 
    echo wp_kses(us_get_option('header_contacts_custom_text'), '<a><strong><span>');
    ?>
</span>
		</div>
	<?php 
}
/* header custom text */
?>
	</div>
</div>

Exemplo n.º 20
0
	color: <?php 
echo us_get_option('color_footer_text');
?>
;
	}

/* Link Color */
.l-subfooter.at_bottom a {
	color: <?php 
echo us_get_option('color_footer_link');
?>
;
	}

/* Link Hover Color */
.no-touch .l-subfooter.at_bottom a:hover {
	color: <?php 
echo us_get_option('color_footer_link_hover');
?>
;
	}

<?php 
echo us_get_option('custom_css', '');
?>

<?php 
if (FALSE) {
    ?>
/* Setting IDE context */</style><?php 
}
Exemplo n.º 21
0
<?php

defined('ABSPATH') or die('This script cannot be accessed directly.');
/**
 * The template for displaying search results pages
 */
$us_layout = US_Layout::instance();
// Needed for canvas class
$us_layout->titlebar = 'default';
$us_layout->sidebar_pos = us_get_option('search_sidebar', 'right');
get_header();
// Creating .l-titlebar
us_load_template('templates/titlebar', array('title' => __('Search Results for', 'us') . ' &quot;' . esc_attr(get_search_query()) . '&quot;'));
$template_vars = array('layout_type' => us_get_option('search_layout', 'large'), 'metas' => array(), 'content_type' => us_get_option('search_content_type', 'excerpt'), 'show_read_more' => !!us_get_option('search_read_more', TRUE), 'pagination' => us_get_option('search_pagination', 'regular'));
foreach (array('date', 'author', 'categories', 'comments', 'tags') as $meta_key) {
    if (us_get_option('search_meta_' . $meta_key, TRUE)) {
        $template_vars['metas'][] = $meta_key;
    }
}
?>
<!-- MAIN -->
<div class="l-main">
	<div class="l-main-h i-cf">

		<div class="l-content g-html">
			<section class="l-section">
				<div class="l-section-h i-cf">

					<?php 
do_action('us_before_search');
?>
Exemplo n.º 22
0
/**
 * Outputs posts related to the current single post
 *
 * @action Before the template: 'us_before_template:templates/blog/single-post-related'
 * @action After the template: 'us_after_template:templates/blog/single-post-related'
 */
if (!has_tag()) {
    return;
}
$tag_ids = wp_get_post_tags(0, array('fields' => 'ids'));
$query_args = array('tag__in' => $tag_ids, 'post__not_in' => array(get_the_ID()), 'paged' => 1, 'showposts' => 3, 'orderby' => 'rand', 'ignore_sticky_posts' => 1, 'post_type' => get_post_type());
// Overloading global wp_query to use it in the inner templates
us_open_wp_query_context();
global $wp_query;
$wp_query = new WP_Query($query_args);
if ($wp_query->have_posts()) {
    $template_vars = array('layout_type' => us_get_option('post_related_layout', 'compact'), 'metas' => array('date'), 'content_type' => 'none', 'show_read_more' => FALSE, 'pagination' => 'none');
    ?>
<section class="l-section for_related">
		<div class="l-section-h i-cf">
			<h5><?php 
    _e('Related Articles', 'us');
    ?>
</h5>
			<?php 
    us_load_template('templates/blog/listing', $template_vars);
    ?>
		</div>
	</section><?php 
}
us_close_wp_query_context();
Exemplo n.º 23
0
    $btn_classes .= ' color_' . $atts['button_color'];
    if ($atts['button_color'] == 'custom') {
        if ($atts['button_bg_color'] != '') {
            $btn_inner_css .= 'background-color: ' . $atts['button_bg_color'] . ';';
        }
        if ($atts['button_text_color'] != '') {
            $btn_inner_css .= 'color: ' . $atts['button_text_color'] . ';';
        }
    }
}
if (!empty($atts['button_style'])) {
    $btn_classes .= ' style_' . $atts['button_style'];
}
$btn_classes .= ' size_' . $atts['button_size'];
$btn_wrapper_classes .= ' align_' . $atts['button_align'];
$btn_text = us_get_option('cform_button_text', us_config('cform.submit'));
$post_id = get_the_ID();
if (!empty($atts['el_class'])) {
    $classes = ' ' . $atts['el_class'];
}
$fields = us_config('cform.fields');
foreach ($fields as $field_name => $field) {
    if (!isset($atts[$field_name . '_field']) or $atts[$field_name . '_field'] == 'hidden') {
        unset($fields[$field_name]);
        continue;
    }
    $fields[$field_name]['required'] = $atts[$field_name . '_field'] == 'required';
    if ($field['type'] == 'captcha') {
        $numbers = array(rand(16, 30), rand(1, 15));
        $sign = rand(0, 1);
        $fields[$field_name]['title'] .= ' ' . implode($sign ? ' + ' : ' - ', $numbers);
Exemplo n.º 24
0
            $output .= '</a>';
        }
        $output .= '</div>';
        if (isset($current_language)) {
            $output .= '<div class="w-lang-current"><span class="w-lang-item"><span class="w-lang-item-icon"></span>';
            $output .= '<span class="w-lang-item-title">' . $current_language['native_name'] . '</span>';
            $output .= '</span></div>';
        }
        $output .= '</div></div>';
    }
} elseif (us_get_option('header_language_source', 'own') == 'own') {
    $output .= '<div class="w-lang layout_dropdown has_title"><div class="w-lang-h">';
    $output .= '<div class="w-lang-list">';
    for ($i = 1; $i <= us_get_option('header_link_qty', 2); $i++) {
        $output .= '<a class="w-lang-item" href="';
        if (substr(us_get_option('header_link_' . $i . '_url'), 0, 4) == 'http') {
            $output .= esc_url(us_get_option('header_link_' . $i . '_url'));
        } else {
            $output .= esc_url('//' . us_get_option('header_link_' . $i . '_url'));
        }
        $output .= '"><span class="w-lang-item-icon"></span>';
        $output .= '<span class="w-lang-item-title">' . us_get_option('header_link_' . $i . '_label') . '</span>';
        $output .= '</a>';
    }
    $output .= '</div>';
    $output .= '<div class="w-lang-current"><span class="w-lang-item"><span class="w-lang-item-icon"></span>';
    $output .= '<span class="w-lang-item-title">' . us_get_option('header_link_title') . '</span>';
    $output .= '</span></div>';
    $output .= '</div></div>';
}
echo $output;
Exemplo n.º 25
0
 /**
  * Obtain CSS classes for .l-header
  *
  * @return string
  */
 public function header_classes()
 {
     $classes = 'layout_' . $this->header_layout;
     $classes .= ' pos_' . $this->header_pos;
     $classes .= ' bg_' . $this->header_bg;
     if ($this->header_bg == 'transparent') {
         // Initial transparent state class
         $classes .= ' transparent';
     }
     if ($this->header_show != 'always') {
         $classes .= ' show_' . $this->header_show;
     }
     if (us_get_option('header_invert_logo_pos', FALSE)) {
         $classes .= ' logopos_right';
     }
     if (us_get_option('header_fullwidth', FALSE)) {
         $classes .= ' width_full';
     }
     return $classes;
 }
Exemplo n.º 26
0
 * (!) Important: this file is not intended to be overloaded, so use the below hooks for customizing instead
 *
 * @action Before the template: 'us_before_template:templates/widgets/nav-main'
 * @action After the template: 'us_after_template:templates/widgets/nav-main'
 */
$menu_location = apply_filters('us_main_menu_location', 'us_main_menu');
if (!has_nav_menu($menu_location)) {
    return;
}
$us_layout = US_Layout::instance();
$classes = '';
$classes .= ' layout_' . ($us_layout->header_layout != 'sided' ? 'hor' : 'ver');
$classes .= ' type_desktop';
$classes .= ' animation_' . us_get_option('menu_dropdown_effect', 'opacity');
if (us_get_option('menu_height')) {
    $classes .= ' height_' . (us_get_option('menu_height') ? 'full' : 'auto');
}
?>
<!-- NAV -->
<nav class="w-nav<?php 
echo $classes;
?>
">
	<div class="w-nav-control"></div>
	<ul class="w-nav-list level_1 hover_none hidden">
		<?php 
wp_nav_menu(array('theme_location' => $menu_location, 'container' => 'ul', 'container_class' => 'w-nav-list', 'walker' => new US_Walker_Nav_Menu(), 'items_wrap' => '%3$s', 'fallback_cb' => FALSE));
?>
	</ul>
</nav><!-- /NAV -->
Exemplo n.º 27
0
defined('ABSPATH') or die('This script cannot be accessed directly.');
/**
 * The template for displaying all single posts and attachments
 */
$us_layout = US_Layout::instance();
// Needed for canvas class
//$us_layout->titlebar = 'default';
get_header();
$metas = array();
foreach (array('date', 'author', 'categories', 'comments') as $meta_key) {
    if (us_get_option('post_meta_' . $meta_key)) {
        $metas[] = $meta_key;
    }
}
$template_vars = array('metas' => $metas, 'show_tags' => !!us_get_option('post_meta_tags'));
?>
<!-- MAIN -->
<div class="l-main">
	<div class="l-main-h i-cf">

		<div class="l-content g-html">

			<?php 
do_action('us_before_single');
?>

			<?php 
while (have_posts()) {
    the_post();
    us_load_template('templates/blog/single-post', $template_vars);
Exemplo n.º 28
0
    $default_logo_url = us_get_option('logo_image');
    $transparent_logo_url = us_get_option('logo_image_transparent');
}
$home_url = function_exists('icl_get_home_url') ? icl_get_home_url() : esc_url(home_url('/'));
?>

<div class="w-logo <?php 
echo $class_name;
?>
">
	<a class="w-logo-link" href="<?php 
echo $home_url;
?>
">
<?php 
if (us_get_option('logo_type', 'text') == 'img') {
    ?>
		<span class="w-logo-img">
<?php 
    if ($default_logo_url) {
        ?>
			<img class="for_default" src="<?php 
        echo esc_url($default_logo_url);
        ?>
" alt="<?php 
        bloginfo('name');
        ?>
">
<?php 
    }
    if ($transparent_logo_url) {
Exemplo n.º 29
0
			<?php 
while (have_posts()) {
    the_post();
    $the_content = apply_filters('the_content', get_the_content());
    // The page may be paginated itself via <!--nextpage--> tags
    $pagination = us_wp_link_pages(array('before' => '<div class="w-blog-pagination"><nav class="navigation pagination" role="navigation">', 'after' => '</nav></div>', 'next_or_number' => 'next_and_number', 'nextpagelink' => '>', 'previouspagelink' => '<', 'link_before' => '<span>', 'link_after' => '</span>', 'echo' => 0));
    // If content has no sections, we'll create them manually
    $has_own_sections = strpos($the_content, ' class="l-section') !== FALSE;
    if (!$has_own_sections) {
        $the_content = '<section class="l-section"><div class="l-section-h i-cf">' . $the_content . $pagination . '</div></section>';
    } elseif (!empty($pagination)) {
        $the_content .= '<section class="l-section"><div class="l-section-h i-cf">' . $pagination . '</div></section>';
    }
    echo $the_content;
    // Post comments
    $show_comments = us_get_option('portfolio_comments', FALSE);
    if ($show_comments and (comments_open() or get_comments_number() != '0')) {
        ?>
<section class="l-section for_comments">
						<div class="l-section-h i-cf"><?php 
        wp_enqueue_script('comment-reply');
        comments_template();
        ?>
</div>
					</section><?php 
    }
}
?>

			<?php 
do_action('us_after_us_portfolio');