コード例 #1
0
/**
 * Load start of theme wrapper function	
*/
function modality_theme_wrapper_start()
{
    $modality_theme_options = modality_get_options('modality_theme_options');
    ?>
	<div id="main" class="<?php 
    echo $modality_theme_options['layout_settings'];
    ?>
">
		<div class="content-posts-wrap">
			<div class="woocommerce">
				<div id="content-box">
					<div id="post-body">
						<div class="post-single">
<?php 
}
コード例 #2
0
<?php

/**
 * Template Name: Page With Right Sidebar
 *
 * @package Modality
 */
$modality_theme_options = modality_get_options('modality_theme_options');
get_header();
?>
	<div id="main" class="col2-l">
	<?php 
// Start the Loop.
while (have_posts()) {
    the_post();
    ?>

<div class="content-posts-wrap">
	<div id="content-box">
		<div id="post-body">
			<div <?php 
    post_class('post-single');
    ?>
>
				<h1 id="post-title" <?php 
    post_class('entry-title');
    ?>
><?php 
    the_title();
    ?>
 </h1>
コード例 #3
0
function company_unslider_slider()
{
    global $post;
    $modality_theme_options = modality_get_options('modality_theme_options');
    $slider_cat = $modality_theme_options['image_slider_cat'];
    $num_of_slides = $modality_theme_options['slider_num'];
    $button_text = $modality_theme_options['caption_button_text'];
    $modality_slider_query = new WP_Query(array('posts_per_page' => $num_of_slides, 'cat' => $slider_cat));
    ?>
	<div class="clear"></div>
	<div class="banner">
		<div class="big_text">О КОМПАНИИ</div>


		<ul>
		<?php 
    while ($modality_slider_query->have_posts()) {
        $modality_slider_query->the_post();
        ?>
			<?php 
        $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail');
        ?>
			<li style="background: url(<?php 
        //echo esc_url($image[0]);
        ?>
) 50% 0 no-repeat;">
			<?php 
        if ($modality_theme_options['captions_on'] == '1') {
            ?>
	
				<div class="inner">
					<a class="post-title" href="<?php 
            the_permalink();
            ?>
"><h1><?php 
            the_title();
            ?>
</h1></a>
					<?php 
            the_excerpt();
            ?>
				</div>
				<?php 
            if ($modality_theme_options['captions_button'] == '1') {
                ?>
					<a href="<?php 
                the_permalink();
                ?>
" class="btn"><?php 
                echo $button_text;
                ?>
</a>
				<?php 
            }
            ?>
			<?php 
        }
        ?>
			
			</li>
		<?php 
    }
    wp_reset_query();
    ?>
		</ul>
	</div>
	<div class="clear"></div>

<?php 
}
コード例 #4
0
/** 
 * Load function to change excerpt length
 * 
 */
function modality_excerpt_length($length)
{
    $modality_theme_options = modality_get_options('modality_theme_options');
    if ($modality_theme_options['blog_excerpt'] != "") {
        $excrpt = $modality_theme_options['blog_excerpt'];
        return $excrpt;
    } else {
        $excrpt = '50';
        return $excrpt;
    }
}
コード例 #5
0
function modality_localize_scripts()
{
    wp_enqueue_script('slides', get_template_directory_uri() . '/js/slides.js', array('jquery'), '', true);
    $modality_theme_options = modality_get_options('modality_theme_options');
    $animation_speed = $modality_theme_options['animation_speed'];
    $slideshow_speed = $modality_theme_options['slideshow_speed'];
    $datatoBePassed = array('slideshowSpeed' => $slideshow_speed, 'animationSpeed' => $animation_speed);
    wp_localize_script('slides', 'php_vars', $datatoBePassed);
}
コード例 #6
0
/**
 * Sets up theme custom styling
 * 
 */
function modality_theme_custom_styling()
{
    $modality_theme_options = modality_get_options('modality_theme_options');
    /**
     * General Settings 
     */
    $theme_color = $modality_theme_options['theme_color'];
    $scrollup_color = $modality_theme_options['scrollup_color'];
    $scrollup_hover_color = $modality_theme_options['scrollup_hover_color'];
    /**
     * Logo Settings 
     */
    $logo_width = $modality_theme_options['logo_width'];
    $logo_height = $modality_theme_options['logo_height'];
    $logo_top_margin = $modality_theme_options['logo_top_margin'];
    $logo_left_margin = $modality_theme_options['logo_left_margin'];
    $logo_bottom_margin = $modality_theme_options['logo_bottom_margin'];
    $logo_right_margin = $modality_theme_options['logo_right_margin'];
    $logo_uppercase = $modality_theme_options['logo_uppercase'];
    $google_font_logo = $modality_theme_options['google_font_logo'];
    $logo_font_size = $modality_theme_options['logo_font_size'];
    $logo_font_weight = $modality_theme_options['logo_font_weight'];
    $text_logo_color = $modality_theme_options['text_logo_color'];
    $tagline_font_size = $modality_theme_options['tagline_font_size'];
    $tagline_color = $modality_theme_options['tagline_color'];
    $tagline_uppercase = $modality_theme_options['tagline_uppercase'];
    /**
     * Navigation Settings
     */
    $menu_sticky = $modality_theme_options['menu_sticky'];
    $menu_top_margin = $modality_theme_options['menu_top_margin'];
    $google_font_menu = $modality_theme_options['google_font_menu'];
    $nav_font_size = $modality_theme_options['nav_font_size'];
    $menu_uppercase = $modality_theme_options['menu_uppercase'];
    $nav_font_color = $modality_theme_options['nav_font_color'];
    $nav_border_color = $modality_theme_options['nav_border_color'];
    $nav_bg_color = $modality_theme_options['nav_bg_color'];
    $nav_bg_sub_color = $modality_theme_options['nav_bg_sub_color'];
    $nav_hover_font_color = $modality_theme_options['nav_hover_font_color'];
    $nav_bg_hover_color = $modality_theme_options['nav_bg_hover_color'];
    $nav_cur_item_color = $modality_theme_options['nav_cur_item_color'];
    /**
     * Typography Settings
     */
    $google_font_body = $modality_theme_options['google_font_body'];
    $body_font_size = $modality_theme_options['body_font_size'];
    $body_font_color = $modality_theme_options['body_font_color'];
    /**
     * Header Settings
     */
    $header_bg_color = $modality_theme_options['header_bg_color'];
    $header_opacity = $modality_theme_options['header_opacity'];
    $address_color = $modality_theme_options['address_color'];
    $top_head_color = $modality_theme_options['top_head_color'];
    /**
     * Image Slider 
     */
    $slider_height = $modality_theme_options['slider_height'];
    $captions_pos_left = $modality_theme_options['captions_pos_left'];
    $captions_pos_top = $modality_theme_options['captions_pos_top'];
    $captions_width = $modality_theme_options['captions_width'];
    $captions_title_color = $modality_theme_options['captions_title_color'];
    $captions_text_color = $modality_theme_options['captions_text_color'];
    $captions_button_color = $modality_theme_options['captions_button_color'];
    /**
     * Footer Settings
     */
    $footer_bg_color = $modality_theme_options['footer_bg_color'];
    $copyright_bg_color = $modality_theme_options['copyright_bg_color'];
    $footer_widget_title_color = $modality_theme_options['footer_widget_title_color'];
    $footer_widget_title_border_color = $modality_theme_options['footer_widget_title_border_color'];
    $footer_widget_text_color = $modality_theme_options['footer_widget_text_color'];
    $footer_widget_text_border_color = $modality_theme_options['footer_widget_text_border_color'];
    $footer_social_color = $modality_theme_options['footer_social_color'];
    /**
     * Blog Settings
     */
    $blog_posts_home_color = $modality_theme_options['blog_posts_home_color'];
    $blog_bg_color = $modality_theme_options['blog_bg_color'];
    $blog_title_color = $modality_theme_options['blog_title_color'];
    $blog_post_color = $modality_theme_options['blog_post_color'];
    $blog_meta_color = $modality_theme_options['blog_meta_color'];
    $blog_posts_top_color = $modality_theme_options['blog_posts_top_color'];
    $blog_posts_top_font_color = $modality_theme_options['blog_posts_top_font_color'];
    /**
     * Get Started Section
     */
    $getst_bg_color = $modality_theme_options['getst_bg_color'];
    $getst_header_color = $modality_theme_options['getst_header_color'];
    $getst_text_color = $modality_theme_options['getst_text_color'];
    $getst_button_color = $modality_theme_options['getst_button_color'];
    /**
     * Features Section
     */
    $features_bg_color = $modality_theme_options['features_bg_color'];
    $features_text_color = $modality_theme_options['features_text_color'];
    $features_title_color = $modality_theme_options['features_title_color'];
    /**
     * About Section
     */
    $about_text_color = $modality_theme_options['about_text_color'];
    $about_bg_color = $modality_theme_options['about_bg_color'];
    $about_header_color = $modality_theme_options['about_header_color'];
    /**
     * Our Services Section
     */
    $services_bg_color = $modality_theme_options['services_bg_color'];
    $services_title_color = $modality_theme_options['services_title_color'];
    $services_text_color = $modality_theme_options['services_text_color'];
    /**
     * Call To Action Section
     */
    $cta_bg_color = $modality_theme_options['cta_bg_color'];
    $cta_sm_color = $modality_theme_options['cta_sm_color'];
    $cta_big_color = $modality_theme_options['cta_big_color'];
    /**
     * Content Boxes Section
     */
    $cont_text_color = $modality_theme_options['cont_text_color'];
    $cont_bg_color = $modality_theme_options['cont_bg_color'];
    $cntbx_title_color = $modality_theme_options['cntbx_title_color'];
    /**
     * Get in Touch Section
     */
    $getin_header_color = $modality_theme_options['getin_header_color'];
    $getin_text_color = $modality_theme_options['getin_text_color'];
    $getin_button_color = $modality_theme_options['getin_button_color'];
    $getin_bg_color = $modality_theme_options['getin_bg_color'];
    /**
     * Social Section
     */
    $social_color = $modality_theme_options['social_color'];
    $output = '';
    /**
     * General Settings 
     */
    if ($theme_color) {
        $output .= 'blockquote, address, .page-links a:hover, .post-format-wrap {border-color:' . $theme_color . '}' . "\n";
    }
    $output .= '.meta span i, .more-link, .post-title h3:hover, #main .standard-posts-wrapper .posts-wrapper .post-single .text-holder-full .post-format-wrap p.link-text a:hover, .breadcrumbs .breadcrumbs-wrap ul li a:hover, #article p a, .navigation a, .link-post i.fa, .quote-post i.fa, #article .link-post p.link-text a:hover, .link-post p.link-text a:hover, .quote-post span.quote-author, .post-single ul.link-pages li a strong, .post-info span i, .footer-widget-col ul li a:hover, .sidebar ul.link-pages li.next-link a span, .sidebar ul.link-pages li.previous-link a span, .sidebar ul.link-pages li i, .row .row-item .service i.fa {color:' . $theme_color . '}' . "\n";
    $output .= 'input[type="submit"],button, .page-links a:hover {background:' . $theme_color . '}' . "\n";
    $output .= '.search-submit,.wpcf7-form-control,.main-navigation ul ul, .content-boxes .circle, .feature .circle, .section-title-right:after, .boxtitle:after, .section-title:after, .content-btn, #comments .form-submit #submit {background-color:' . $theme_color . '}' . "\n";
    if ($scrollup_color) {
        $output .= '.back-to-top {color:' . $scrollup_color . '}' . "\n";
    }
    if ($scrollup_hover_color) {
        $output .= '.back-to-top i.fa:hover {color:' . $scrollup_hover_color . '}' . "\n";
    }
    /**
     * Logo Settings 
     */
    if ($logo_width) {
        $output .= '#logo {width:' . $logo_width . 'px }' . "\n";
    }
    if ($logo_height) {
        $output .= '#logo {height:' . $logo_height . 'px }' . "\n";
    }
    if ($logo_top_margin) {
        $output .= '#logo { margin-top:' . $logo_top_margin . 'px }' . "\n";
    }
    if ($logo_left_margin) {
        $output .= '#logo { margin-left:' . $logo_left_margin . 'px }' . "\n";
    }
    if ($logo_bottom_margin) {
        $output .= '#logo { margin-bottom:' . $logo_bottom_margin . 'px }' . "\n";
    }
    if ($logo_right_margin) {
        $output .= '#logo { margin-right:' . $logo_right_margin . 'px }' . "\n";
    }
    if ($logo_uppercase == '1') {
        $output .= '#logo {text-transform: uppercase }' . "\n";
    }
    if ($google_font_logo) {
        $output .= '#logo {font-family:' . $google_font_logo . '}' . "\n";
    }
    if ($logo_font_size) {
        $output .= '#logo {font-size:' . $logo_font_size . 'px }' . "\n";
    }
    if ($logo_font_weight) {
        $output .= '#logo {font-weight:' . $logo_font_weight . '}' . "\n";
    }
    if ($text_logo_color) {
        $output .= '#logo a {color:' . $text_logo_color . '}' . "\n";
    }
    if ($tagline_font_size) {
        $output .= '#logo h5.site-description {font-size:' . $tagline_font_size . 'px }' . "\n";
    }
    if ($tagline_color) {
        $output .= '#logo .site-description {color:' . $tagline_color . '}' . "\n";
    }
    if ($tagline_uppercase == '0') {
        $output .= '#logo .site-description {text-transform: none}' . "\n";
    }
    if ($tagline_uppercase == '1') {
        $output .= '#logo .site-description {text-transform: uppercase}' . "\n";
    }
    /**
     * Navigation Settings
     */
    if ($menu_top_margin) {
        $output .= '#navbar {margin-top:' . $menu_top_margin . 'px}' . "\n";
    }
    if ($google_font_menu) {
        $output .= '#navbar ul li a {font-family:' . $google_font_menu . '}' . "\n";
    }
    if ($nav_font_size) {
        $output .= '#navbar ul li a {font-size:' . $nav_font_size . 'px}' . "\n";
    }
    if ($menu_uppercase == '1') {
        $output .= '#navbar ul li a {text-transform: uppercase;}' . "\n";
    }
    if ($nav_font_color) {
        $output .= '.navbar-nav li a {color:' . $nav_font_color . '}' . "\n";
    }
    if ($nav_border_color) {
        $output .= '.dropdown-menu {border-bottom: 5px solid ' . $nav_border_color . '}' . "\n";
    }
    if ($nav_bg_color) {
        $output .= '.navbar-nav {background-color:' . $nav_bg_color . '}' . "\n";
    }
    if ($nav_bg_sub_color) {
        $output .= '.dropdown-menu { background:' . $nav_bg_sub_color . '}' . "\n";
    }
    if ($nav_hover_font_color) {
        $output .= '.navbar-nav li a:hover {color:' . $nav_hover_font_color . '}' . "\n";
    }
    if ($nav_bg_hover_color) {
        $output .= '.navbar-nav ul li a:hover, .navbar-nav ul li a:focus, .navbar-nav ul li a.active, .navbar-nav ul li a.active-parent, .navbar-nav ul li.current_page_item a, #menu-navmenu li a:hover { background:' . $nav_bg_hover_color . '}' . "\n";
    }
    if ($nav_cur_item_color) {
        $output .= '.active a { color:' . $nav_cur_item_color . ' !important}' . "\n";
    }
    /**
     * Typography Settings
     */
    if ($google_font_body != 'None') {
        $output .= 'body {font-family:' . $google_font_body . '}' . "\n";
    }
    if ($body_font_size) {
        $output .= 'body {font-size:' . $body_font_size . 'px !important}' . "\n";
    }
    if ($body_font_color) {
        $output .= 'body {color:' . $body_font_color . '}' . "\n";
    }
    /**
     * Header Settings
     */
    if ($header_bg_color) {
        $output .= '#header-holder { background-color: ' . $header_bg_color . '}' . "\n";
    }
    if ($header_opacity) {
        $output .= '#header-holder {opacity:' . $header_opacity . '}' . "\n";
    }
    if ($address_color) {
        $output .= '#header-top .top-phone,#header-top p, #header-top a, #header-top i { color:' . $address_color . '}' . "\n";
    }
    if ($top_head_color) {
        $output .= '#header-top { background-color: ' . $top_head_color . '}' . "\n";
    }
    /**
     * Image Slider 
     */
    if ($slider_height) {
        $output .= '.banner ul li { height:' . $slider_height . 'px;}' . "\n";
    }
    if ($captions_title_color) {
        $output .= '.banner .inner h1 { color:' . $captions_title_color . '}' . "\n";
    }
    if ($captions_text_color) {
        $output .= '.banner .inner p { color: ' . $captions_text_color . '}' . "\n";
    }
    if ($captions_button_color) {
        $output .= '.banner .btn { color: ' . $captions_button_color . '}' . "\n";
    }
    $output .= '.banner .btn { border-color: ' . $captions_button_color . '}' . "\n";
    if ($captions_pos_left) {
        $output .= '.banner .inner { padding-left: ' . $captions_pos_left . '%}' . "\n";
    }
    if ($captions_pos_top) {
        $output .= '.banner .inner { padding-top: ' . $captions_pos_top . 'px}' . "\n";
    }
    if ($captions_width) {
        $output .= '.banner .inner { width: ' . $captions_width . '%}' . "\n";
    }
    /**
     * Footer Settings
     */
    if ($footer_bg_color) {
        $output .= '#footer { background-color:' . $footer_bg_color . '}' . "\n";
    }
    if ($copyright_bg_color) {
        $output .= '#copyright { background-color:' . $copyright_bg_color . '}' . "\n";
    }
    if ($footer_widget_title_color) {
        $output .= '.footer-widget-col h4 { color:' . $footer_widget_title_color . '}' . "\n";
    }
    if ($footer_widget_title_border_color) {
        $output .= '.footer-widget-col h4 { border-bottom: 4px solid ' . $footer_widget_title_border_color . '}' . "\n";
    }
    if ($footer_widget_text_color) {
        $output .= '.footer-widget-col a, .footer-widget-col { color:' . $footer_widget_text_color . '}' . "\n";
    }
    if ($footer_widget_text_border_color) {
        $output .= '.footer-widget-col ul li { border-bottom: 1px solid ' . $footer_widget_text_border_color . '}' . "\n";
    }
    if ($footer_social_color) {
        $output .= '#social-bar-footer ul li a i { color:' . $footer_social_color . '}' . "\n";
    }
    /**
     * Blog Settings 
     */
    if ($blog_posts_home_color) {
        $output .= '.home-blog {background: none repeat scroll 0 0 ' . $blog_posts_home_color . '}' . "\n";
    }
    if ($blog_meta_color) {
        $output .= '.from-blog .post-info span a, .from-blog .post-info span {color:' . $blog_meta_color . ';}' . "\n";
    }
    if ($blog_post_color) {
        $output .= '.from-blog h3 {color:' . $blog_post_color . ';}' . "\n";
    }
    if ($blog_title_color) {
        $output .= '.from-blog h2 {color:' . $blog_title_color . ';}' . "\n";
    }
    if ($blog_bg_color) {
        $output .= '.from-blog {background: none repeat scroll 0 0 ' . $blog_bg_color . ';}' . "\n";
    }
    if ($blog_posts_top_color) {
        $output .= '.blog-top-image {background: none repeat scroll 0 0 ' . $blog_posts_top_color . ';}' . "\n";
    }
    if ($blog_posts_top_font_color) {
        $output .= '.blog-top-image h1.section-title, .blog-top-image h1.section-title-right {color:' . $blog_posts_top_font_color . ';}' . "\n";
    }
    /**
     * Get Started Section
     */
    if ($getst_button_color) {
        $output .= '.get-strated-button { background-color: ' . $getst_button_color . '}' . "\n";
    }
    if ($getst_header_color) {
        $output .= '#get-started h2 { color: ' . $getst_header_color . '}' . "\n";
    }
    if ($getst_text_color) {
        $output .= '.get-strated-left span { color: ' . $getst_text_color . '}' . "\n";
    }
    if ($getst_bg_color) {
        $output .= '#get-started { background: none repeat scroll 0 0 ' . $getst_bg_color . '}' . "\n";
    }
    /**
     * Features Section
     */
    if ($features_bg_color) {
        $output .= '#features { background-color:' . $features_bg_color . ';}' . "\n";
    }
    if ($features_text_color) {
        $output .= 'h4.sub-title, #features p { color:' . $features_text_color . ';}' . "\n";
    }
    if ($features_title_color) {
        $output .= '#features .section-title, #features h3 { color:' . $features_title_color . ';}' . "\n";
    }
    /**
     * About Section
     */
    if ($about_text_color) {
        $output .= '.about p {color:' . $about_text_color . ';}' . "\n";
    }
    if ($about_header_color) {
        $output .= '.about h2 {color:' . $about_header_color . ';}' . "\n";
    }
    if ($about_bg_color) {
        $output .= '.about {background: none repeat scroll 0 0 ' . $about_bg_color . ';}' . "\n";
    }
    /**
     * Our Services Section
     */
    if ($services_bg_color) {
        $output .= '#services { background-color:' . $services_bg_color . ';}' . "\n";
    }
    if ($services_title_color) {
        $output .= '#services h2, #services h3 { color:' . $services_title_color . ';}' . "\n";
    }
    if ($services_text_color) {
        $output .= '#services p { color:' . $services_text_color . ';}' . "\n";
    }
    /**
     * Call To Action Section
     */
    if ($cta_big_color) {
        $output .= '.cta h2 { color:' . $cta_big_color . ';}' . "\n";
    }
    if ($cta_sm_color) {
        $output .= '.cta h4 { color:' . $cta_sm_color . ';}' . "\n";
    }
    if ($cta_bg_color) {
        $output .= '.cta { background-color:' . $cta_bg_color . ';}' . "\n";
    }
    /**
     * Content Boxes Section
     */
    if ($cntbx_title_color) {
        $output .= '.content-boxes h4 { color:' . $cntbx_title_color . ';}' . "\n";
    }
    if ($cont_text_color) {
        $output .= '.content-boxes {color:' . $cont_text_color . '}' . "\n";
    }
    if ($cont_bg_color) {
        $output .= '.content-boxes {background: none repeat scroll 0 0 ' . $cont_bg_color . '}' . "\n";
    }
    /**
     * Get in Touch Section
     */
    if ($getin_bg_color) {
        $output .= '.get-in-touch { background-color: ' . $getin_bg_color . '}' . "\n";
    }
    if ($getin_header_color) {
        $output .= '.get-in-touch h2.boxtitle {color:' . $getin_header_color . ';}' . "\n";
    }
    if ($getin_text_color) {
        $output .= '.get-in-touch h4.sub-title {color:' . $getin_text_color . ';}' . "\n";
    }
    if ($getin_button_color) {
        $output .= '.git-link { color: ' . $getin_button_color . '}' . "\n";
    }
    $output .= '.git-link { border-color: ' . $getin_button_color . '}' . "\n";
    /**
     * Social Section
     */
    if ($social_color) {
        $output .= '.social { background-color: ' . $social_color . '}' . "\n";
    }
    // Output styles
    if (isset($output) && $output != '') {
        $output = strip_tags($output);
        $output = "<!--Custom Styling-->\n<style media=\"screen\" type=\"text/css\">\n" . esc_html($output) . "</style>\n";
        echo $output;
    }
}