コード例 #1
0
ファイル: widgets.php プロジェクト: JBNavadiya/iced-mocha
 function ColumnsWidget()
 {
     $widget_ops = array('classname' => 'ColumnsWidget', 'description' => 'Add columns in the presentation page');
     $control_ops = array('width' => 350, 'height' => 350);
     // making widget window larger
     $this->WP_Widget('columns_widget', 'Espresso Column', $widget_ops, $control_ops);
     $this->iced_mochas = iced_mocha_get_theme_options();
     // reading theme options
 }
コード例 #2
0
ファイル: ajax.php プロジェクト: JBNavadiya/iced-mocha
function espresso_theme_ajax_init()
{
    // loading our theme settings
    $iced_mochas = iced_mocha_get_theme_options();
    foreach ($iced_mochas as $key => $value) {
        ${"{$key}"} = $value;
    }
    if (is_front_page() && $iced_mocha_frontpage == "Enable") {
        $the_query = new WP_Query(array('posts_per_page' => $iced_mochas['iced_mocha_frontpostscount']));
    } else {
        return;
    }
    // Enqueue JS
    wp_enqueue_script('espresso_theme_ajax_more', get_template_directory_uri() . '/js/ajax.js', array('jquery'), '1.0', true);
    // Max number of pages
    $page_number_max = $the_query->max_num_pages;
    // Next page to load
    $page_number_next = get_query_var('paged') > 1 ? get_query_var('paged') + 1 : 2;
    // Add some parameters for the JS.
    wp_localize_script('espresso_theme_ajax_more', 'espresso_theme_ajax_more', array('page_number_next' => $page_number_next, 'page_number_max' => $page_number_max, 'page_link_model' => get_pagenum_link(9999999), 'load_more_str' => __('More posts', 'iced_mocha'), 'content_css_selector' => '#content', 'pagination_css_selector' => '.pagination, .navigation'));
}
コード例 #3
0
ファイル: comments.php プロジェクト: JBNavadiya/iced-mocha
<?php

/**
 * The template for displaying Comments.
 *
 * The area of the page that contains both current comments
 * and the comment form.  The actual display of comments is
 * handled by a callback to iced_mocha_comment which is
 * located in the includes/theme-comments.php file.
 *
 * @package Iced Mocha
 * @subpackage iced_mocha
 * @since iced_mocha 0.5
 */
$iced_mochas = iced_mocha_get_theme_options();
foreach ($iced_mochas as $key => $value) {
    ${"{$key}"} = is_array($value) ? $value : esc_attr($value);
}
$iced_mocha_comclass = '';
if (!comments_open() && get_comments_number() < 1 && ($iced_mocha_comclosed == "Hide everywhere" || is_page() && $iced_mocha_comclosed == "Hide in pages" || is_single() && $iced_mocha_comclosed == "Hide in posts")) {
    $iced_mocha_comclass = "hideme";
}
?>
 
<div id="comments" class="<?php 
echo $iced_mocha_comclass;
?>
"> <?php 
if (get_comments_number() < 1) {
} else {
    if (post_password_required()) {
コード例 #4
0
function iced_mocha_customjs()
{
    $iced_mochas = iced_mocha_get_theme_options();
    foreach ($iced_mochas as $key => $value) {
        ${"{$key}"} = is_array($value) ? $value : esc_attr($value);
    }
    echo '<script type="text/javascript">';
    echo 'var espresso_theme_global_content_width = ' . $iced_mocha_sidewidth . ';';
    echo 'var espresso_theme_toTop_offset = ' . ($iced_mocha_sidewidth + $iced_mocha_sidebar) . ';';
    if (is_rtl()) {
        echo 'var espresso_theme_toTop_offset =  ' . ($iced_mocha_sidewidth + $iced_mocha_sidebar) . ';';
    }
    if ($iced_mocha_customjs != "") {
        echo PHP_EOL . htmlspecialchars_decode($iced_mocha_customjs, ENT_QUOTES);
    }
    echo '</script>';
}
コード例 #5
0
function iced_mocha_mobile_body_class($classes)
{
    $iced_mochas = iced_mocha_get_theme_options();
    if ($iced_mochas['iced_mocha_mobile'] == "Enable") {
        $browser = $_SERVER['HTTP_USER_AGENT'];
        $keys = 'mobile|android|mobi|tablet|ipad|opera mini|series 60|s60|blackberry';
        if (preg_match("/({$keys})/i", $browser)) {
            $classes[] = 'mobile';
        }
        // mobile browser detected
    }
    return $classes;
}
コード例 #6
0
/**
 * Frontpage helper functions
 * Creates the custom css for the presentation page
 *
 * @package iced_mocha
 * @subpackage Functions
 */
function iced_mocha_presentation_css()
{
    $iced_mochas = iced_mocha_get_theme_options();
    foreach ($iced_mochas as $key => $value) {
        ${"{$key}"} = $value;
    }
    ob_start();
    echo '<style type="text/css">';
    if ($iced_mocha_fronthideheader) {
        ?>
 #branding {display: none;} <?php 
    }
    if ($iced_mocha_fronthidemenu) {
        ?>
 #access, .topmenu {display: none;} <?php 
    }
    if ($iced_mocha_fronthidewidget) {
        ?>
 #colophon {display: none;} <?php 
    }
    if ($iced_mocha_fronthidefooter) {
        ?>
 #footer2 {display: none;} <?php 
    }
    if ($iced_mocha_fronthideback) {
        ?>
 #main {background: none;} <?php 
    }
    if ($iced_mocha_fpslider_topmargin) {
        ?>
 .slider-wrapper {padding-top: <?php 
        echo $iced_mocha_fpslider_topmargin;
        ?>
px;} <?php 
    }
    ?>

.slider-wrapper {
	width: <?php 
    echo $iced_mocha_fpsliderwidth;
    ?>
px ;
	max-height: <?php 
    echo $iced_mocha_fpsliderheight;
    ?>
px ;
	}
.slider-shadow {
	/* width: <?php 
    echo $iced_mocha_fpsliderwidth;
    ?>
px ; */
	}
#slider{
	width: <?php 
    echo $iced_mocha_fpsliderwidth;
    ?>
px ;
	max-height: <?php 
    echo $iced_mocha_fpsliderheight;
    ?>
px ;
<?php 
    if ($iced_mocha_fpslider_bordersize) {
        ?>
 border:<?php 
        echo $iced_mocha_fpslider_bordersize;
        ?>
px solid <?php 
        echo $iced_mocha_fpsliderbordercolor;
        ?>
; <?php 
    }
    ?>
 }
.theme-default .nivo-controlNav {top:-<?php 
    echo $iced_mocha_fpslider_bordersize + 33;
    ?>
px;}

#front-text1 h1, #front-text2 h1{
	color: <?php 
    echo $iced_mocha_fronttitlecolor;
    ?>
; }

#front-columns > div {
	width: <?php 
    switch ($iced_mocha_nrcolumns) {
        case 0:
            break;
        case 1:
            echo "100";
            break;
        case 2:
            echo "47.5";
            break;
        case 3:
            echo "30";
            break;
        case 4:
            echo "21.2";
            break;
    }
    ?>
%; }

#front-columns > div.column<?php 
    echo $iced_mocha_nrcolumns;
    ?>
 { margin-right: 0; }

.column-image img {	height:<?php 
    echo $iced_mocha_colimageheight;
    ?>
px;}
.column-image img {	max-width:<?php 
    echo $iced_mocha_colimagewidth;
    ?>
px;  max-height:<?php 
    echo $iced_mocha_colimageheight;
    ?>
px;}

.nivo-caption { background-color: rgba(<?php 
    echo espresso_theme_hex2rgb($iced_mocha_fpslidercaptionbg);
    ?>
,0.7); }
.nivo-caption, .nivo-caption a { color: <?php 
    echo $iced_mocha_fpslidercaptioncolor;
    ?>
; }
.theme-default .nivo-controlNav, .theme-default .nivo-directionNav a { background-color:<?php 
    echo $iced_mocha_fpsliderbordercolor;
    ?>
; }
.slider-bullets .nivo-controlNav a { background-color: <?php 
    echo $iced_mocha_sidetitlebg;
    ?>
; }
.slider-bullets .nivo-controlNav a:hover { background-color: <?php 
    echo $iced_mocha_menucolorbgdefault;
    ?>
; }
.slider-bullets .nivo-controlNav a.active {background-color: <?php 
    echo $iced_mocha_accentcolora;
    ?>
; }
.slider-numbers .nivo-controlNav a { color:<?php 
    echo $iced_mocha_fpslidercaptioncolor;
    ?>
;background-color:<?php 
    echo $iced_mocha_fpslidercaptionbg;
    ?>
;}
.slider-numbers .nivo-controlNav a:hover { color: <?php 
    echo $iced_mocha_accentcolora;
    ?>
; }
.slider-numbers .nivo-controlNav a.active { color:<?php 
    echo $iced_mocha_accentcolora;
    ?>
;}


.column-image h3{ color: <?php 
    echo $iced_mocha_contentcolortxt;
    ?>
; background-color: rgba(<?php 
    echo espresso_theme_hex2rgb($iced_mocha_contentcolorbg);
    ?>
,0.6); }
.columnmore { background-color: <?php 
    echo $iced_mocha_backcolormain;
    ?>
; }
#front-columns h3.column-header-noimage { background: <?php 
    echo $iced_mocha_contentcolorbg;
    ?>
; }

<?php 
    echo '</style>';
    $iced_mocha_presentation_page_styling = ob_get_contents();
    ob_end_clean();
    return $iced_mocha_presentation_page_styling;
}