function helium_modify_portfolio_slug($args)
 {
     $slug = trim(Youxi()->option->get('portfolio_slug'));
     if ($slug && $slug != youxi_portfolio_cpt_name()) {
         $args['query_var'] = $slug;
         $args['rewrite'] = compact('slug');
     }
     return $args;
 }
Example #2
0
 function helium_ajax_js_vars($vars)
 {
     $vars = is_array($vars) ? $vars : array();
     if (Youxi()->option->get('ajax_navigation')) {
         $excludeUrls = explode(PHP_EOL, Youxi()->option->get('ajax_exclude_urls'));
         $excludeUrls = array_filter($excludeUrls);
         $excludeUrls = array_merge(array(includes_url(), content_url(), wp_login_url(), plugins_url(), admin_url()), $excludeUrls);
         $vars['ajax'] = array('enabled' => true, 'scrollTop' => Youxi()->option->get('ajax_navigation_scroll_top'), 'loadingText' => Youxi()->option->get('ajax_navigation_loading_text'), 'excludeUrls' => $excludeUrls);
     }
     return $vars;
 }
Example #3
0
 function helium_entry_pagination($pagination_type = 'numbered', $query = null)
 {
     $before = '<div class="content-box clearfix">';
     $before .= '<div class="content-wrap-inner no-padding">';
     $before .= '<nav class="content-nav" role="navigation" itemscope itemtype="http://schema.org/SiteNavigationElement">';
     $after = '</nav></div></div>';
     if ('infinite' == $pagination_type || 'ajax' == $pagination_type || 'numbered' == $pagination_type) {
         echo Youxi()->pagination->paginate_links($before, $after, array('list_class' => 'plain-list', 'list_item_class' => 'content-nav-link', 'show_all' => 'infinite' == $pagination_type || 'ajax' == $pagination_type, 'prev_text' => '<span class="content-nav-link-wrap"><i class="fa fa-chevron-left"></i></span>', 'next_text' => '<span class="content-nav-link-wrap"><i class="fa fa-chevron-right"></i></span>', 'before_page_number' => '<span class="content-nav-link-wrap">', 'after_page_number' => '</span>'), $query);
     } else {
         $next_posts_link_label = '<span class="content-nav-link-wrap">' . '<span class="fa fa-chevron-left"></span>' . '<span class="content-nav-link-label">' . esc_html__('Older Posts', 'helium') . '</span>' . '</span>';
         $previous_posts_link_label = '<span class="content-nav-link-wrap">' . '<span class="content-nav-link-label">' . esc_html__('Newer Posts', 'helium') . '</span>' . '<span class="fa fa-chevron-right"></span>' . '</span>';
         echo Youxi()->pagination->posts_link($before, $after, array('next_posts_link_label' => $next_posts_link_label, 'previous_posts_link_label' => $previous_posts_link_label, 'list_class' => 'plain-list', 'list_item_class' => 'content-nav-link'), $query);
     }
 }
Example #4
0
 function helium_edd_grid_defaults()
 {
     return wp_parse_args(array('show_filter' => Youxi()->option->get('edd_grid_show_filter'), 'pagination' => Youxi()->option->get('edd_grid_pagination'), 'ajax_button_text' => Youxi()->option->get('edd_grid_ajax_button_text'), 'ajax_button_complete_text' => Youxi()->option->get('edd_grid_ajax_button_complete_text'), 'posts_per_page' => Youxi()->option->get('edd_grid_posts_per_page'), 'include' => Youxi()->option->get('edd_grid_include'), 'behavior' => Youxi()->option->get('edd_grid_behavior'), 'columns' => Youxi()->option->get('edd_grid_columns')), array('show_filter' => true, 'pagination' => 'ajax', 'ajax_button_text' => 'Load More', 'ajax_button_complete_text' => 'No More Items', 'posts_per_page' => get_option('posts_per_page'), 'include' => array(), 'behavior' => 'lightbox', 'columns' => 4));
 }
Example #5
0
						</div>
						<?php 
}
?>

					</div>

				</div>

			</div>

		</div>

		<?php 
if (Youxi()->option->get('portfolio_show_related_items')) {
    Youxi()->templates->get('related', null, get_post_type());
}
?>

		<?php 
if (have_comments() || comments_open()) {
    ?>
		<div class="content-box clearfix">

			<div class="entry-comments-wrap">

				<div class="content-wrap-inner three-quarters-vertical-padding">

					<div class="container">

						<div class="row">
<?php

$grid_settings = helium_portfolio_grid_defaults();
get_header();
?>
<div class="content-area-wrap">

	<div class="content-area fullwidth">

		<div class="content-header">

			<div class="content-header-affix clearfix"><?php 
?>
<h1 class="content-title">
					<?php 
single_term_title(Youxi()->option->get('portfolio_archive_page_title') . ': ');
?>
				</h1>

			</div>

		</div>

		<div class="content-wrap">

			<?php 
if (have_posts()) {
    $gridlist_classes = array('portfolio-grid', 'grid-list', 'grid-list-' . $grid_settings['layout']);
    if ('justified' != $grid_settings['layout']) {
        $col_class = strtr($grid_settings['columns'], array(3 => 'three', 4 => 'four', 5 => 'five'));
        $gridlist_classes[] = $col_class . '-columns';
Example #7
0
 function helium_typekit_enable_cache($enabled)
 {
     return (bool) Youxi()->option->get('typekit_cache');
 }
global $wp_query;
$grid_settings = helium_edd_grid_defaults();
get_header();
?>
<div class="content-area-wrap">

	<div class="content-area fullwidth">

		<div class="content-header">

			<div class="content-header-affix clearfix"><?php 
?>
<h1 class="content-title">
					<?php 
single_term_title(Youxi()->option->get('edd_archive_page_title') . ': ');
?>
				</h1>

			</div>

		</div>

		<div class="content-wrap">

			<?php 
if (have_posts()) {
    $gridlist_classes = array('edd-download-grid', 'grid-list', 'grid-list-masonry');
    $col_class = strtr($grid_settings['columns'], array(3 => 'three', 4 => 'four', 5 => 'five'));
    $gridlist_classes[] = $col_class . '-columns';
    // Prepare EDD HTML attributes
Example #9
0
    ?>
<h1 class="content-title">
					<?php 
    echo strtr(Youxi()->option->get('blog_single_title'), array('{title}' => get_the_title()));
    ?>
				</h1><?php 
    ?>
<nav class="content-nav" role="navigation" itemscope itemtype="http://schema.org/SiteNavigationElement">
					<ul class="plain-list"><?php 
    previous_post_link('<li class="content-nav-link">%link</li>', '<span class="content-nav-link-wrap">' . '<span class="fa fa-chevron-left"></span>' . '<span class="content-nav-link-label">' . esc_html__('Previous Post', 'helium') . '</span>' . '</span>');
    next_post_link('<li class="content-nav-link">%link</li>', '<span class="content-nav-link-wrap">' . '<span class="content-nav-link-label">' . esc_html__('Next Post', 'helium') . '</span>' . '<span class="fa fa-chevron-right"></span>' . '</span>');
    ?>
</ul>
				</nav>

			</div>

		</div>

		<div class="content-wrap">
			<?php 
    Youxi()->templates->get('entry', get_post_format(), get_post_type());
    ?>
		</div>

	</div>

</div>
<?php 
}
get_footer();
Example #10
0
        ?>
<section class="post-tags"><?php 
        the_tags('', '');
        ?>
</section>

								<?php 
    }
    if (Youxi()->option->get('blog_sharing')) {
        Youxi()->templates->get('parts/sharing', get_post_format(), get_post_type());
    }
    if (Youxi()->option->get('blog_show_author')) {
        Youxi()->templates->get('parts/author', get_post_format(), get_post_type());
    }
    if (Youxi()->option->get('blog_related_posts')) {
        Youxi()->templates->get('parts/related', get_post_format(), get_post_type());
    }
    if (have_comments() || comments_open()) {
        comments_template();
    }
}
?>

						</div>

					</div>

				</div>

			</div>
Example #11
0
/*
Template Name: EDD Store
*/
if (!class_exists('Easy_Digital_Downloads')) {
    get_template_part('page');
    return;
}
global $wp_query;
// Template is used for displaying edd archive
if (is_post_type_archive('download')) {
    /* Get the portfolio grid settings from defaults */
    $grid_settings = helium_edd_grid_defaults();
    /* Make sure the included categories is an empty array */
    $grid_settings['include'] = array();
    /* Get default archive title */
    $the_title = Youxi()->option->get('edd_archive_page_title');
    $the_query = $wp_query;
    // Template used as page template
} else {
    if (have_posts()) {
        the_post();
        /* Get the download grid settings */
        $grid_settings = $post->edd_grid_settings;
        if (!isset($grid_settings['use_defaults']) || !$grid_settings['use_defaults']) {
            $grid_settings = wp_parse_args($grid_settings, helium_edd_grid_defaults());
        } else {
            $grid_settings = helium_edd_grid_defaults();
        }
        if (is_front_page() && !is_home()) {
            $paged = get_query_var('page') ? intval(get_query_var('page')) : 1;
        } else {
Example #12
0
<?php

get_header();
?>

<div class="content-area-wrap">

	<?php 
if (have_posts()) {
    the_post();
    Youxi()->templates->get('entry', null, get_post_type());
}
?>

</div>

<?php 
get_footer();
Example #13
0
							</button>

						</div>

						<div class="header-content-bottom">

							<nav class="main-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
								<?php 
wp_nav_menu(array('theme_location' => 'main-menu', 'container' => false, 'fallback_cb' => 'helium_fallback_menu', 'walker' => class_exists('Helium_Walker_Nav_Menu') ? new Helium_Walker_Nav_Menu() : ''));
?>
							</nav>

							<?php 
get_sidebar();
if (Youxi()->option->get('copyright_text')) {
    ?>
							<div class="header-copyright"><?php 
    echo Youxi()->option->get('copyright_text');
    ?>
</div>
							<?php 
}
?>

						</div>

					</div>

				</div>

			</header>
Example #14
0
$related_posts_count = Youxi()->option->get('blog_related_posts_count');
$related_posts = Youxi()->entries->get_related($related_posts_count);
if (!empty($related_posts)) {
    ?>
<section class="post-related-posts">

	<h3 class="post-section-title h4"><?php 
    esc_html_e('Related Posts', 'helium');
    ?>
</h3>

	<div class="row"><?php 
    global $post;
    $related_posts = array_slice($related_posts, 0, $related_posts_count);
    $col_width = min(12, 12 / max($related_posts_count, count($related_posts)));
    $use_lightbox = 'lightbox' === Youxi()->option->get('blog_related_posts_behavior');
    foreach ($related_posts as $post) {
        setup_postdata($post);
        ?>
<article <?php 
        post_class(array('related-entry', 'col-md-' . $col_width));
        ?>
>

		<?php 
        if (has_post_thumbnail()) {
            if ($use_lightbox) {
                ?>
<figure class="related-entry-media">
				<a href="<?php 
                echo esc_url(wp_get_attachment_url(get_post_thumbnail_id()));
Example #15
0
<?php

$sharing_buttons = Youxi()->option->get('addthis_sharing_buttons');
$sharing_buttons = array_filter(array_map('trim', explode(',', $sharing_buttons)));
if (!empty($sharing_buttons)) {
    ?>
<section class="post-sharing">

	<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url="<?php 
    the_permalink();
    ?>
" addthis:title="<?php 
    the_title_attribute();
    ?>
">
		<?php 
    array_walk($sharing_buttons, 'helium_sharing_button');
    ?>
	</div>

</section>
<?php 
}
Example #16
0
	<div class="royalSlider rsHelium" data-rs-settings="<?php 
        echo esc_attr(helium_rs_settings($post_format_meta));
        ?>
"><?php 
        foreach ($post_format_meta['images'] as $image) {
            $attachment = wp_get_attachment_image_src($image, 'full');
            echo wp_get_attachment_image($image, 'full', false, array('class' => 'attachment-full rsImg', 'data-rsw' => $attachment[1], 'data-rsh' => $attachment[2]));
        }
        ?>
</div>

	<?php 
    } elseif ('justified' === $post_format_meta['type']) {
        ?>

	<div class="justified-grids"><?php 
        foreach ($post_format_meta['images'] as $image) {
            echo wp_get_attachment_image($image, 'full');
        }
        ?>
</div>
	<?php 
    }
    ?>

</section>
<?php 
} else {
    Youxi()->templates->get('media/media', null, get_post_type());
}
 function helium_widgets_twitter_keys($keys)
 {
     return array('consumer_key' => trim(Youxi()->option->get('twitter_consumer_key')), 'consumer_secret' => trim(Youxi()->option->get('twitter_consumer_secret')), 'oauth_token' => trim(Youxi()->option->get('twitter_access_token')), 'oauth_token_secret' => trim(Youxi()->option->get('twitter_access_token_secret')));
 }
Example #18
0
 function helium_portfolio_grid_defaults()
 {
     return wp_parse_args(array('show_filter' => Youxi()->option->get('portfolio_grid_show_filter'), 'pagination' => Youxi()->option->get('portfolio_grid_pagination'), 'ajax_button_text' => Youxi()->option->get('portfolio_grid_ajax_button_text'), 'ajax_button_complete_text' => Youxi()->option->get('portfolio_grid_ajax_button_complete_text'), 'posts_per_page' => Youxi()->option->get('portfolio_grid_posts_per_page'), 'include' => Youxi()->option->get('portfolio_grid_include'), 'behavior' => Youxi()->option->get('portfolio_grid_behavior'), 'orderby' => Youxi()->option->get('portfolio_grid_orderby'), 'order' => Youxi()->option->get('portfolio_grid_order'), 'layout' => Youxi()->option->get('portfolio_grid_layout'), 'columns' => Youxi()->option->get('portfolio_grid_columns')), array('show_filter' => true, 'pagination' => 'ajax', 'ajax_button_text' => esc_html__('Load More', 'helium'), 'ajax_button_complete_text' => esc_html__('No More Items', 'helium'), 'posts_per_page' => get_option('posts_per_page'), 'include' => array(), 'behavior' => 'lightbox', 'orderby' => 'date', 'order' => 'DESC', 'layout' => 'masonry', 'columns' => 4));
 }
Example #19
0
						<div class="row">

							<div class="col-lg-12">

								<h2 class="no-margin-top">
									<?php 
printf(esc_html__('Search Results for &ldquo;%s&rdquo;', 'helium'), get_search_query());
?>
								</h2>

								<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        Youxi()->templates->get('entry', 'search');
    }
} else {
    esc_html_e('Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'helium');
}
?>

							</div>

						</div>

					</div>

				</div>

			</div>
Example #20
0
			<div class="row">
				
				<div class="col-lg-12">
					<h4 class="bordered no-margin-top"><?php 
    esc_html_e('Related Items', 'helium');
    ?>
</h4>
				</div>

			</div>

			<div class="row"><?php 
    global $post;
    $related_posts = array_slice($related_posts, 0, $related_items_count);
    $col_width = min(12, 12 / max($related_items_count, count($related_posts)));
    $use_lightbox = 'lightbox' === Youxi()->option->get('portfolio_related_items_behavior');
    foreach ($related_posts as $post) {
        setup_postdata($post);
        ?>
<article <?php 
        post_class(array('related-entry', 'col-md-' . $col_width));
        ?>
>

				<?php 
        if (has_post_thumbnail()) {
            if ($use_lightbox) {
                ?>
<figure class="related-entry-media">
						<a href="<?php 
                echo esc_url(wp_get_attachment_url(get_post_thumbnail_id()));
Example #21
0
/*
Template Name: Portfolio
*/
if (!function_exists('youxi_portfolio_cpt_name')) {
    get_template_part('page');
    return;
}
global $wp_query;
// Template is used for displaying portfolio archive
if (is_post_type_archive(youxi_portfolio_cpt_name())) {
    /* Get the portfolio grid settings from defaults */
    $grid_settings = helium_portfolio_grid_defaults();
    /* Make sure the included categories is an empty array */
    $grid_settings['include'] = array();
    /* Get default archive title */
    $the_title = Youxi()->option->get('portfolio_archive_page_title');
    $the_query = $wp_query;
    // Template used as page template
} else {
    if (have_posts()) {
        the_post();
        /* Get the portfolio grid settings */
        $grid_settings = $post->portfolio_grid_settings;
        if (!isset($grid_settings['use_defaults']) || !$grid_settings['use_defaults']) {
            $grid_settings = wp_parse_args($grid_settings, helium_portfolio_grid_defaults());
        } else {
            $grid_settings = helium_portfolio_grid_defaults();
        }
        if (is_front_page() && !is_home()) {
            $paged = get_query_var('page') ? intval(get_query_var('page')) : 1;
        } else {
Example #22
0
					
					<time class="post-date updated" datetime="<?php 
echo esc_attr(get_the_date('c'));
?>
" itemprop="datePublished"><?php 
echo esc_html(get_the_date(get_option('date_format')));
?>
</time>

					<?php 
if (is_single()) {
    the_title('<h2 class="entry-title post-title" itemprop="name">', '</h2>');
} else {
    the_title('<h2 class="entry-title post-title" itemprop="name"><a href="' . esc_url(get_permalink()) . '" itemprop="url">', '</a></h2>');
}
$hidden_post_meta = Youxi()->option->get('hidden_post_meta');
$hidden_post_meta = $hidden_post_meta ? $hidden_post_meta : array();
?>
<div class="post-meta">

						<ul class="post-meta-list inline-list"><?php 
if (is_sticky() && !is_single()) {
    ?>
<li><i class="fa fa-paperclip"></i> <?php 
    esc_html_e('Sticky', 'helium');
    ?>
</li>
							<?php 
}
if (!in_array('author', $hidden_post_meta)) {
    ?>
Example #23
0
 function helium_wp_enqueue_script()
 {
     /* Get theme version */
     $wp_theme = wp_get_theme();
     $theme_version = $wp_theme->exists() ? $wp_theme->get('Version') : false;
     /* Get script debug status */
     $script_debug = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG;
     $suffix = $script_debug ? '' : '.min';
     /* Enqueue Core Styles */
     wp_enqueue_style('helium-bootstrap', get_template_directory_uri() . "/assets/bootstrap/css/bootstrap{$suffix}.css", array(), '3.3.5', 'screen');
     wp_enqueue_style('helium-core', get_stylesheet_uri(), array('helium-bootstrap'), $theme_version, 'screen');
     /* Enqueue Google Fonts */
     if ($google_fonts_url = Youxi_Font::google_font_request_url()) {
         wp_enqueue_style('helium-google-fonts', $google_fonts_url, array(), $theme_version, 'screen');
     }
     /* Enqueue Icons */
     wp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css', array(), '4.4.0', 'screen');
     /* Make sure the LESS compiler exists */
     if (!class_exists('Youxi_LESS_Compiler')) {
         require_once get_template_directory() . '/lib/framework/class-less-compiler.php';
     }
     $less_compiler = Youxi_LESS_Compiler::get();
     /* Prepare variables */
     $theme_options_vars = array();
     /* Get the accent color setting */
     $brand_primary = Youxi()->option->get('accent_color', helium_default_accent_color());
     /* Custom accent color styles */
     if (helium_default_accent_color() !== $brand_primary) {
         wp_add_inline_style('helium-bootstrap', $less_compiler->compile('/assets/less/mods/bootstrap.less', array('bs-override' => array('brand-primary' => $brand_primary))));
         $theme_options_vars['brand-primary'] = $brand_primary;
     }
     /* Custom theme styles */
     if ($header_logo_height = absint(Youxi()->option->get('logo_height'))) {
         $theme_options_vars['logo-height'] = sprintf('%dpx', $header_logo_height);
     }
     /* Add custom styles from theme options */
     $theme_options_css = $less_compiler->compile('/assets/less/mods/theme-options.less', array('theme-options' => $theme_options_vars));
     if (!is_wp_error($theme_options_css)) {
         wp_add_inline_style('helium-core', $theme_options_css);
     }
     /* Add custom fonts from theme options */
     $font_less_vars = Youxi_Font::get_less_vars();
     if (!empty($font_less_vars)) {
         $theme_fonts_css = $less_compiler->compile('/assets/less/mods/theme-fonts.less', array('theme-fonts' => $font_less_vars));
         if (!is_wp_error($theme_fonts_css)) {
             wp_add_inline_style('helium-core', $theme_fonts_css);
         }
     }
     /* Custom user styles */
     $custom_css = trim(Youxi()->option->get('custom_css'));
     if ($custom_css) {
         wp_add_inline_style('helium-core', $custom_css);
     }
     /* Core */
     if ($script_debug) {
         wp_enqueue_script('helium-plugins', get_template_directory_uri() . "/assets/js/helium.plugins.js", array('jquery'), $theme_version, true);
         wp_enqueue_script('helium-gridlist', get_template_directory_uri() . "/assets/js/helium.gridlist.js", array('jquery'), $theme_version, true);
         wp_enqueue_script('helium-core', get_template_directory_uri() . "/assets/js/helium.setup.js", array('jquery', 'helium-plugins', 'helium-gridlist'), $theme_version, true);
     } else {
         wp_enqueue_script('helium-core', get_template_directory_uri() . "/assets/js/helium.min.js", array('jquery'), $theme_version, true);
     }
     /* AJAX */
     $ajax_enabled = Youxi()->option->get('ajax_navigation');
     if ($ajax_enabled) {
         wp_enqueue_script('helium-ajax', get_template_directory_uri() . "/assets/js/helium.ajax{$suffix}.js", array('helium-core'), $theme_version, true);
     }
     /* Enqueue wp-mediaelement if AJAX is enabled */
     if ($ajax_enabled) {
         wp_enqueue_script('wp-mediaelement');
     }
     /* Enqueue Magnific Popup */
     wp_enqueue_script('helium-mfp', get_template_directory_uri() . "/assets/plugins/mfp/jquery.mfp-1.0.0{$suffix}.js", array('jquery'), '1.0.0', true);
     wp_enqueue_style('helium-mfp', get_template_directory_uri() . "/assets/plugins/mfp/mfp.css", array(), '1.0.0', 'screen');
     /* Enqueue Isotope */
     wp_enqueue_script('helium-isotope', get_template_directory_uri() . "/assets/plugins/isotope/isotope.pkgd{$suffix}.js", array('jquery'), '2.2.0', true);
     /* Enqueue RoyalSlider */
     wp_enqueue_script('helium-royalslider', get_template_directory_uri() . "/assets/plugins/royalslider/jquery.royalslider-9.5.7.min.js", array('jquery'), '9.5.7', true);
     wp_enqueue_style('helium-royalslider', get_template_directory_uri() . "/assets/plugins/royalslider/royalslider{$suffix}.css", array(), '1.0.5', 'screen');
     /* Enqueue Google Maps */
     wp_enqueue_script('helium-gmap3', get_template_directory_uri() . "/assets/plugins/gmap/gmap3{$suffix}.js", array('jquery'), '6.0.0.', true);
     /* Pass configuration to frontend */
     wp_localize_script('helium-core', '_helium', apply_filters('helium_js_vars', array('ajaxUrl' => admin_url('admin-ajax.php'), 'homeUrl' => home_url('/'))));
     /* Enqueue AddThis script on singular pages */
     if (is_singular(array('post', 'portfolio', 'download')) || $ajax_enabled) {
         $addthis_config = array('ui_delay' => 100);
         if ($addthis_profile_id = Youxi()->option->get('addthis_profile_id')) {
             $addthis_config['pubid'] = $addthis_profile_id;
         }
         wp_enqueue_script('helium-addthis', '//s7.addthis.com/js/300/addthis_widget.js', array(), 300, true);
         wp_localize_script('helium-addthis', 'addthis_config', $addthis_config);
     }
     /* Enqueue comment-reply */
     if ((is_singular(array('post', 'portfolio', 'download')) || $ajax_enabled) && comments_open() && get_option('thread_comments')) {
         wp_enqueue_script('comment-reply');
     }
 }