/**
 * Theme logo
 * @param string $logo_field
 * @param string $default_url
 */
function rhythm_logo($logo_field = '', $default_url = '', $class = 'logo')
{
    if (empty($logo_field)) {
        $logo_field = 'logo';
    }
    $logo = '';
    $logo_retina = '';
    if (ts_get_opt($logo_field) != null) {
        $logo_array = ts_get_opt($logo_field);
    }
    ?>
	<a class="<?php 
    echo sanitize_html_classes($class);
    ?>
" href="<?php 
    echo esc_url(ts_get_home_url());
    ?>
" title="<?php 
    echo esc_attr(get_bloginfo('name'));
    ?>
"> 
		<?php 
    if (!isset($logo_array['url']) || empty($logo_array['url'])) {
        echo '<img src="' . esc_url($default_url) . '" alt="' . esc_attr(get_bloginfo('name')) . '" />';
    } else {
        echo '<img src="' . esc_url($logo_array['url']) . '" alt="' . esc_attr(get_bloginfo('name')) . '" />';
    }
    ?>
	</a>
	<?php 
}
/**
 * Title wrapper template
 */
function ts_get_title_wrapper_template_part()
{
    $template = ts_get_opt('title-wrapper-template');
    switch ($template) {
        case 'magazine':
            get_template_part('templates/title/magazine');
            break;
        case 'modern':
            get_template_part('templates/title/modern');
            break;
        default:
            get_template_part('templates/title/default');
    }
}
示例#3
0
<?php

/**
 * The template for displaying archive pages.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package Rhythm
 */
$oArgs = ThemeArguments::getInstance('templates/pages/index');
$oArgs->set('template', ts_get_opt('archive-template'));
$oArgs->set('columns', ts_get_opt('archive-columns'));
get_template_part('templates/pages/index');
$oArgs->reset();
示例#4
0
</span></a>
		<?php 
    } else {
        ?>
			<a nohref class="work-prev inactive"><span><i class="fa fa-chevron-left"></i>&nbsp;<?php 
        _e('Previous', 'rhythm');
        ?>
</span></a>
		<?php 
    }
    ?>
		
		<!---->
		
		<?php 
    $page = ts_get_opt('portfolio-page');
    if ($page) {
        ?>
			<a href="<?php 
        echo esc_url(get_permalink($page));
        ?>
" class="work-all"><span><i class="fa fa-times"></i>&nbsp;<?php 
        _e('All works', 'rhythm');
        ?>
</span></a>
		<?php 
    }
    ?>
		
		
		<?php 
示例#5
0
?>
">
	<div class="container relative">
		<?php 
get_template_part('templates/global/page-before-content');
?>
		<?php 
while (have_posts()) {
    the_post();
    ?>
			<?php 
    get_template_part('templates/content/content', 'page');
    ?>
			<?php 
    // If comments are open or we have at least one comment, load up the comment template
    if (ts_get_opt('page-comments-enable') == 1 && (comments_open() || get_comments_number())) {
        comments_template();
    }
    ?>
		<?php 
}
// end of the loop
?>
		<?php 
get_template_part('templates/global/page-after-content');
?>
	</div>
</section>
<!-- End Page Section -->
<?php 
get_footer();
示例#6
0
 * Modern title bar layout
 */
if (ts_get_opt('title-wrapper-enable') == 1) {
    $style_class = ts_get_opt('title-wrapper-style');
    if (empty($style_class)) {
        $style_class .= 'bg-gray-lighter';
    }
    $parallax_effect = ts_get_opt('title-wrapper-parallax-effect');
    if (!empty($parallax_effect)) {
        $style_class .= ' ' . $parallax_effect;
    }
    $subtitle_class = '';
    if (in_array($style_class, array('bg-gray-lighter', 'bg-gray'))) {
        $subtitle_class = 'dark-subtitle';
    }
    $background = ts_get_opt('title-wrapper-background');
    $background_data = '';
    $add_bg = false;
    if (is_array($background) && $background['url'] != '') {
        $add_bg = true;
    }
    ?>
	<!-- Title Wrapper Section -->
	<section class="page-section pt-sm-110 pb-sm-90 <?php 
    echo sanitize_html_classes($style_class);
    ?>
" <?php 
    echo true === $add_bg ? 'style="background-image: url(' . esc_url($background['url']) . ');"' : '';
    ?>
>
		<div class="relative container align-center">
示例#7
0
        }
        $header_button_target = ts_get_opt('header-button-target') ? ts_get_opt('header-button-target') : '_blank';
        ?>
						<li>
							<a class="header-button" href="<?php 
        echo esc_url(ts_get_opt('header-button-link'));
        ?>
" target="<?php 
        echo esc_attr($header_button_target);
        ?>
"><span class="btn btn-mod btn-circle <?php 
        echo sanitize_html_classes($button_style);
        ?>
"><?php 
        echo ts_get_opt('header-button-icon') ? '<i class="' . sanitize_html_classes(ts_get_opt('header-button-icon')) . '"></i> ' : '';
        echo esc_html(ts_get_opt('header-button-text'));
        ?>
</span></a>
							<?php 
        ?>
						</li>
					<?php 
    }
    ?>
				</ul>
				
			</div>
			<!-- End Main Menu -->
		</div>
	</nav>
	<!-- End Navigation panel -->
示例#8
0
/* 
 * Default preheader layout
 */
?>

<?php 
if (ts_get_opt('preheader-enable-switch') == 1) {
    ?>
	<!-- Top Bar -->
		<div class="top-bar <?php 
    echo ts_get_opt('preheader-style') == 'dark' ? 'dark' : '';
    ?>
">
			<div class="<?php 
    echo ts_get_opt('preheader-full-width') ? 'full-wrapper' : 'container';
    ?>
 clearfix">

				<!-- Top Links -->
				<?php 
    if (has_nav_menu('preheader-left')) {
        wp_nav_menu(array('theme_location' => 'preheader-left', 'container' => false, 'menu_id' => 'preheader-left-nav', 'menu_class' => 'top-links left', 'depth' => 1, 'walker' => new rhythm_menu_widget_walker_nav_menu()));
    }
    ?>
				<!-- End Top Links -->

				<!-- Social Links -->
				<?php 
    if (has_nav_menu('preheader-right')) {
        wp_nav_menu(array('theme_location' => 'preheader-right', 'container' => false, 'menu_id' => 'preheader-right-nav', 'menu_class' => 'top-links right tooltip-bot', 'depth' => 1, 'walker' => new rhythm_menu_widget_walker_nav_menu()));
<?php

/**
 * The sidebar footer containing the main widget area.
 *
 * @package Rhythm
 */
if (ts_get_opt('footer-widgets-enable') == 1) {
    ?>
	<!-- Divider -->
	<hr class="mt-0 mb-0"/>
	<!-- End Divider -->

	<!-- Widgets Section -->
	<section class="footer-sidebar page-section">
		<div class="container relative">
			<div class="row multi-columns-row">
				<div class="col-sm-6 col-md-3 col-lg-3">
					<?php 
    if (is_active_sidebar(ts_get_custom_sidebar('footer-1', 'footer-sidebar-1'))) {
        ?>
						<?php 
        dynamic_sidebar(ts_get_custom_sidebar('footer-1', 'footer-sidebar-1'));
        ?>
					<?php 
    }
    ?>
				</div>
				<div class="col-sm-6 col-md-3 col-lg-3">
					<?php 
    if (is_active_sidebar(ts_get_custom_sidebar('footer-2', 'footer-sidebar-2'))) {
示例#10
0
<?php

/**
 * The template for displaying search results pages.
 *
 * @package Rhythm
 */
$oArgs = ThemeArguments::getInstance('templates/pages/index');
$oArgs->set('template', ts_get_opt('search-template'));
$oArgs->set('columns', ts_get_opt('search-columns'));
get_template_part('templates/pages/index');
$oArgs->reset();
示例#11
0
/**
 * Add under construction notice to admin bar for logged user
 * @global type $wp_admin_bar
 */
function ts_under_construction_mode_to_admin_bar()
{
    global $wp_admin_bar;
    if (ts_get_opt('enable-under-construction') == 1) {
        $wp_admin_bar->add_menu(array('id' => 'wpse-form-in-admin-bar', 'parent' => 'top-secondary', 'title' => '<span style="color: #FF0000;">Under Construction</span>'));
    }
}
示例#12
0
<?php

/** 
 * Related part for portfolio single
 * 
 * @package Rhythm
 */
$related_projects = ts_get_opt('portfolio-related-projects');
if (in_array($related_projects, array('related_projects', 'latest_projects'))) {
    $args = array('posts_per_page' => 4, 'offset' => 0, 'meta_query' => array(array('key' => '_thumbnail_id')), 'cat' => '', 'orderby' => 'date', 'order' => 'DESC', 'include' => '', 'exclude' => get_the_ID(), 'meta_key' => '', 'meta_value' => '', 'post_type' => 'portfolio', 'post_mime_type' => '', 'post_parent' => '', 'paged' => 1, 'post_status' => 'publish', 'post__not_in' => array(get_the_ID()));
    $show_related = false;
    if ($related_projects == 'related_projects') {
        $parent_categories = wp_get_object_terms(get_the_ID(), 'portfolio-category', array('fields' => 'ids'));
        if (is_array($parent_categories) && count($parent_categories) > 0) {
            $args['tax_query'][] = array('taxonomy' => 'portfolio-category', 'field' => 'term_id', 'terms' => $parent_categories);
            $show_related = true;
        }
        $header = __('Related Projects', 'rhythm');
    } else {
        $header = __('Latest Projects', 'rhythm');
        $show_related = true;
    }
    if ($show_related) {
        $the_query = new WP_Query($args);
        ?>
	
		<?php 
        if ($the_query->have_posts()) {
            ?>

			<!-- Divider -->
示例#13
0
	<div class="fm-wrapper" id="fullscreen-menu">
		<div class="fm-wrapper-sub">
			<div class="fm-wrapper-sub-sub">

				<?php 
    $menu = '';
    if (is_singular()) {
        $menu = ts_get_post_opt('header-primary-menu');
    }
    if (has_nav_menu('primary')) {
        wp_nav_menu(array('theme_location' => 'primary', 'menu' => $menu, 'container' => false, 'menu_id' => 'primary-nav', 'menu_class' => 'fm-menu-links local-scroll', 'depth' => 2, 'walker' => new rhythm_modern_menu_widget_walker_nav_menu()));
    }
    ?>

				<?php 
    if (ts_get_opt('header-enable-search')) {
        ?>
					<ul class="fm-menu-links local-scroll fm-menu-search">	
						<li>
							<!-- Search -->
							<a href="#" class="fm-has-sub"><?php 
        _e('Search', 'rhythm');
        ?>
 <i class="fa fa-angle-down"></i></a>
							<ul class="fm-sub">
								<li>
									<div class="mn-wrap">
										<form method="get" class="form align-center" action="<?php 
        echo esc_url(ts_get_home_url());
        ?>
">
 */
?>
<!-- Navigation panel -->
<nav class="main-nav dark transparent stick-fixed">
	<div class="full-wrapper relative clearfix">
		<!-- Logo ( * your text or image into link tag *) -->
		<div class="nav-logo-wrap local-scroll">
			<?php 
rhythm_logo('logo-light', get_template_directory_uri() . '/images/logo.png');
?>
		</div>
		<div class="mobile-nav">
			<i class="fa fa-bars"></i>
		</div>
		<!-- Main Menu -->
		<div class="inner-nav desktop-nav">
			<ul class="clearlist scroll-nav local-scroll">
				<li><?php 
echo wp_kses_post(ts_get_opt('under-construction-header1'));
?>
</li>
				<li><?php 
echo wp_kses_post(ts_get_opt('under-construction-header2'));
?>
</li>
			</ul>
		</div>
	</div>
</nav>
<!-- End Navigation panel -->
示例#15
0
<?php

/**
 * Title wrapper search
 */
if (ts_get_opt('title-wrapper-search') == 1) {
    ?>
	<!-- Search Section -->
	<section class="small-section">
		<div class="container relative">
			<!-- Search -->
			<form class="form-inline form" role="form" action="<?php 
    echo esc_url(ts_get_home_url());
    ?>
">
				<div class="search-wrap">
					<button class="search-button animate" type="submit" title="<?php 
    echo esc_attr(__('Start Search', 'rhythm'));
    ?>
">
						<i class="fa fa-search"></i>
					</button>
					<input type="text" name="s" class="form-control search-field" placeholder="<?php 
    echo esc_attr(__('Search...', 'rhythm'));
    ?>
">
				</div>
			</form>
			<!-- End Search -->
		</div>
	</section>
<?php

/**
 * Content wrapper presented before the loop (eg. used in page.php)
 * 
 * @package Rhythm
 */
$layout = ts_get_opt('main-layout');
if ($layout == 'left_sidebar') {
    ?>
	<div class="row">
		<?php 
    get_sidebar();
    ?>
		<div class="col-sm-8 col-md-offset-1">
			<!-- Page Content -->

<?php 
} elseif ($layout == 'right_sidebar') {
    ?>
	<div class="row">
		<div class="col-sm-8">
			<!-- Page Content -->
<?php 
} else {
    ?>
	<div class="row">
		<div class="col-sm-10 col-sm-offset-1">
			<!-- Page Content -->
<?php 
}
示例#17
0
<?php

/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package Rhythm
 */
$oArgs = ThemeArguments::getInstance('templates/pages/index');
$oArgs->set('template', ts_get_opt('blog-template'));
$oArgs->set('columns', ts_get_opt('blog-columns'));
get_template_part('templates/pages/index');
$oArgs->reset();
						<div class="hs-line-12 font-alt mb-10">
							<?php 
echo wp_kses_post(ts_get_opt('under-construction-title'));
?>
						</div>

						<div class="hs-line-6 no-transp font-alt mb-40">
							<?php 
echo wp_kses_post(ts_get_opt('under-construction-subtitle'));
?>
						</div>

						<p>
							<?php 
echo wp_kses_post(ts_get_opt('under-construction-text'));
?>
						</p>

					</div>
					<!-- End Headings -->

				</div>
			</div>
		</div>
		<!-- End Hero Content -->

	</div>
</section>
<!-- End Home Section -->
<?php 
示例#19
0
        rhythm_social_links();
        ?>
				</div>                    <!-- End Social Links -->
			<?php 
    }
    ?>
			<!-- Footer Text -->
			<div class="footer-text">
				<div class="footer-copy font-alt">
					<?php 
    echo ts_get_opt('footer-text-content');
    ?>
				</div>
				<div class="footer-made">
					<?php 
    echo ts_get_opt('footer-small-text-content');
    ?>
				</div>
			</div>
			<!-- End Footer Text -->
		</div>
		<!-- Top Link -->
		<div class="local-scroll">
			<a href="#top" class="link-to-top"><i class="fa fa-caret-up"></i></a>
		</div>
		<!-- End Top Link -->
	</footer>        <!-- End Foter -->
<?php 
}
?>
</div><!-- End Page Wrap -->
示例#20
0
/**
 * Get custom sidebar, returns $default if custom sidebar is not defined
 * @param string $default
 * @param string $sidebar_option_field
 * @return string
 */
function ts_get_custom_sidebar($default = '', $sidebar_option_field = 'sidebar')
{
    $sidebar = ts_get_opt($sidebar_option_field);
    if ($sidebar != 'default' && !empty($sidebar)) {
        return $sidebar;
    }
    return $default;
}
示例#21
0
<?php

/**
 * Media for single post
 * 
 * @package Rhythm
 */
if (ts_get_opt('post-enable-media')) {
    $format = get_post_format();
    switch ($format) {
        case 'audio':
            ?>
			<!-- Media -->
			<div class="blog-media">
				<?php 
            $audio = ts_get_post_opt('post-audio-url');
            if (!empty($audio)) {
                echo do_shortcode('[audio src="' . esc_url($audio) . '"]');
            }
            ?>

				<a href="<?php 
            echo esc_url(get_permalink());
            ?>
">
					<?php 
            if (has_post_thumbnail()) {
                the_post_thumbnail('ts-full');
            }
            ?>
				</a>
        case 'classic':
        default:
            get_template_part('templates/portfolio/parts/gallery');
    }
    ?>
		<?php 
}
?>

		<?php 
if (ts_get_opt('portfolio-enable-project-details') == 1) {
    ?>
			<?php 
    get_template_part('templates/portfolio/parts/project-details');
    ?>
		<?php 
}
?>

		<?php 
if (ts_get_opt('portfolio-content-bottom') == 1) {
    ?>
			<?php 
    get_template_part('templates/portfolio/parts/editor-content');
    ?>
		<?php 
}
?>
	</div>
</article><!-- #post-## -->
示例#23
0
    if (!empty($preloader_custom_image)) {
        ?>
			<div class="loader-image">
				<img src="<?php 
        echo esc_url($preloader_custom_image);
        ?>
" alt="<?php 
        _e('Loading...', 'rhythm');
        ?>
"/>
			</div>
		<?php 
    }
    ?>
		<div class="loader"><?php 
    _e('Loading...', 'rhythm');
    ?>
</div>
	</div>    <!-- End Page Loader -->
<?php 
}
?>
<!-- Page Wrap -->
<div class="page" id="top">
	<?php 
if (ts_get_opt('enable-under-construction') == 1 && !current_user_can('level_10')) {
    get_template_part('templates/header/under-construction');
} else {
    get_template_part('templates/preheader/default');
    ts_get_header_template_part();
}
示例#24
0
            ?>
				<?php 
            dynamic_sidebar(ts_get_custom_sidebar('main'));
            ?>
			<?php 
        }
        ?>
		</div>
		<!-- End Sidebar -->
		<?php 
        break;
    case 'right_sidebar':
        ?>
		<!-- Sidebar -->
		<div class="col-sm-4 <?php 
        echo ts_get_opt('sidebar-size') == '4columns' ? 'col-md-4' : 'col-md-3 col-md-offset-1';
        ?>
 sidebar">
			<?php 
        if (is_active_sidebar(ts_get_custom_sidebar('main'))) {
            ?>
				<?php 
            dynamic_sidebar(ts_get_custom_sidebar('main'));
            ?>
			<?php 
        }
        ?>
		</div>
		<!-- End Sidebar -->	
		<?php 
        break;
示例#25
0
/**
 * Register widget area.
 *
 * @link http://codex.wordpress.org/Function_Reference/register_sidebar
 */
function rhythm_widgets_init()
{
    register_sidebar(array('name' => __('Main Sidebar', 'rhythm'), 'id' => 'main', 'description' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h5 class="widget-title font-alt">', 'after_title' => '</h5>'));
    for ($i = 1; $i <= 4; $i++) {
        register_sidebar(array('name' => __('Footer Sidebar', 'rhythm') . ' ' . $i, 'id' => 'footer-' . $i, 'description' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h5 class="widget-title font-alt">', 'after_title' => '</h5>'));
    }
    //adding custom sidebars defined in theme options
    $custom_sidebars = ts_get_opt('custom-sidebars');
    if (is_array($custom_sidebars)) {
        foreach ($custom_sidebars as $sidebar) {
            if (empty($sidebar)) {
                continue;
            }
            register_sidebar(array('name' => $sidebar, 'id' => sanitize_title($sidebar), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h5 class="widget-title font-alt">', 'after_title' => '</h5>'));
        }
    }
    if (ts_woocommerce_enabled()) {
        register_sidebar(array('name' => __('Shop Single Post Sidebar', 'rhythm'), 'id' => 'shop-single', 'description' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h5 class="widget-title font-alt">', 'after_title' => '</h5>'));
    }
}