示例#1
0
function st_flex_js_settings()
{
    $settings = array('animation' => 'string', 'animationLoop' => 'bool', 'animationDuration' => 'int', 'slideshow' => 'bool', 'slideshowSpeed' => 'int', 'animationSpeed' => 'int', 'pauseOnAction' => 'bool', 'pauseOnHover' => 'bool', 'controlNav' => 'bool', 'randomize' => 'bool', 'directionNav' => 'bool');
    $js_options = array();
    foreach ($settings as $name => $type) {
        $v = st_get_setting('flex_' . $name, '');
        if (isset($v) && !empty($v)) {
            $js_options[$name] = st_data_type($v, $type);
        }
    }
    $js_options['nextText'] = '<i class="icon-chevron-right"></i>';
    $js_options['prevText'] = '<i class="icon-chevron-left"></i>';
    return $js_options;
}
示例#2
0
} elseif ((is_archive() || is_day() || is_date() || is_month() || is_year() || is_time()) && !is_category()) {
    if (is_day()) {
        $title = sprintf(__('Daily Archives: %s', 'smooththemes'), '<span>' . get_the_date() . '</span>');
    } elseif (is_month()) {
        $title = sprintf(__('Monthly Archives: %s', 'smooththemes'), '<span>' . get_the_date(_x('F Y', 'monthly archives date format', 'smooththemes')) . '</span>');
    } elseif (is_year()) {
        $title = sprintf(__('Yearly Archives: %s', 'smooththemes'), '<span>' . get_the_date(_x('Y', 'yearly archives date format', 'smooththemes')) . '</span>');
    } else {
        $title = __('Blog Archives', 'smooththemes');
    }
} elseif (is_404()) {
    $title = __('Oops, Page not found.', 'smooththemes');
} elseif ((is_home() || is_front_page()) && !is_page()) {
    // default if user do not select static page
    if (st_get_setting('show_blog_toptitle', 'y') != 'n') {
        $title = st_get_setting('blog_toptitle', '');
    }
}
if ($title != '') {
    if (!$show_breadcrumbs) {
        ?>
	<h1 class="page-title has-border"><?php 
        echo $title;
        ?>
</h1>
	<?php 
    } else {
        ?>
	<div class="page-title-wrapper has-border">
		<h1 class="page-title left"><?php 
        echo $title;
示例#3
0
文件: single.php 项目: alysilv/sila
        
        <div class="clear"></div>
    </div><!-- END page-content-->
    
    <div class="page-single-element">
    
    <?php 
if (st_get_setting('s_show_post_tag', 'y') != 'n') {
    ?>
        <p class="page-tags">
            <?php 
    the_tags('<b>' . __('Tags:', 'smooththemes') . '</b> ', '', '');
    ?>
        </p>
        <div class="clear"></div>
    <?php 
}
?>

     <?php 
if (st_get_setting('s_show_comments', 'y') != 'n') {
    ?>
      <?php 
    comments_template('', true);
    ?>
      <?php 
}
?>
      
      
    </div><!-- Single Page Element -->
示例#4
0
/**
 * Display  Reservation Button 
*/
function st_head_reservation_btn($echo = true)
{
    $html = '';
    // if show this button
    if (st_get_setting("show_head_reservation_btn", 'y') != 'n') {
        $url = st_get_setting('reservation_btn_link', '#');
        $text = st_get_setting('reservation_btn_txt', __('Reservation', 'smooththemes'));
        $skin = st_get_setting('reservation_btn_skin');
        $is_custom = st_get_setting('reservation_btn_custom_skin', 'n');
        $custom_c = st_get_setting('reservation_btn_color');
        if ($is_custom != 'n') {
            $custom_c = $custom_c != '' ? $custom_c : $skin;
        } else {
            $custom_c = $skin;
        }
        $btn_attr = ' class="btn btn_green" ';
        if ($custom_c != '') {
            $btn_attr = ' class="btn"  style="background-color: #' . esc_attr($custom_c) . '; " ';
        }
        $html = '<span class="res-btn-w"><a' . $btn_attr . 'href="' . $url . '"><i class="date_icon"></i> ' . esc_html($text) . '</a></span>';
    }
    if ($echo) {
        echo $html;
        return '';
    } else {
        return $html;
    }
}
示例#5
0
            <div class="clear"></div>
   
        <?php 
    } elseif (is_singular('room')) {
        ?>
      
        <div class="page-title-wrapper">
                <h1 class="page-title left"><?php 
        echo $title;
        ?>
</h1>
                <div class="page-title-alt right">
                    <?php 
        // show button in top title
        if (st_get_setting('room_show_res_btn', 'y') != 'n') {
            echo '<a class="btn book_this_room" href="' . st_get_setting('room_res_btn_link', '#') . '">' . st_get_setting('room_res_btn_txt', __('Book this room', 'smooththemes')) . '</a>';
        }
        ?>
                    
                </div>
                <div class="clear"></div>
            </div>
        
        <?php 
    } else {
        ?>
        
        <div class="page-title-wrapper">
            <h1 class="page-title left"><?php 
        echo $title;
        ?>
示例#6
0
</article><!-- /.post  -->



<?php 
if (st_get_setting("enable_author_desc", 'y') == 'y') {
    ?>
<div class="author-details b30">
        <h3><?php 
    _e('Author Description', 'smooththemes');
    ?>
</h3>
        <div class="author-inner">
            <?php 
    echo get_avatar($post->post_author, 90);
    ?>
            <div class="author-desc">
                  <p class="author-text"><?php 
    the_author_meta('description');
    ?>
 </p>
            </div>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
</div><!-- /.author-details -->
<?php 
}
if (st_get_setting("s_show_comments", 'y') == 'y') {
    comments_template('', true);
}
示例#7
0
文件: st-load.php 项目: alysilv/sila
 function st_theme_updater()
 {
     $username = trim(st_get_setting('tf_username'));
     $api_key = trim(st_get_setting('tf_api'));
     if (!empty($username) && !empty($api_key)) {
         load_template(ST_DIR . '/updater/envato-theme-update.php');
         if (class_exists('Envato_Theme_Updater')) {
             Envato_Theme_Updater::init($username, $api_key, 'textdomain');
         }
     }
 }
示例#8
0
function st_builder_meta_layout_sidebar($name = '', $values = array(), $post = false)
{
    global $wp_registered_sidebars;
    ?>
    <div class="layout-wrap">
     <div class="layout">
       <h4><?php 
    _e('Layout', 'smooththemes');
    ?>
</h4>
        <?php 
    $layouts = array('3' => array('title' => 'Two columns, left sidebar', 'img' => ST_ADMIN_URL . '/page-builder/images/layout/2.png'), '2' => array('title' => 'Two columns, right sidebar', 'img' => ST_ADMIN_URL . '/page-builder/images/layout/1.png'), '1' => array('title' => 'One column, no sidebar', 'img' => ST_ADMIN_URL . '/page-builder/images/layout/0.png'));
    $layout_name = $name . '[layout]';
    $current_layout = $values['layout'];
    if (empty($current_layout)) {
        $values['layout'] = $current_layout = in_array($post->post_type, array('portfolio')) ? '1' : st_get_setting("layout", 2);
        // default right sidebar
    }
    foreach ($layouts as $k => $item) {
        // $check=$this->radio_checked($k);
        $class = "";
        $check = "";
        if ($k != '' && $k == $current_layout) {
            $class = " label-checked";
            $check = '  checked="checked" ';
        }
        $image = $item['img'];
        $input .= '<div class="stpb-layout-item' . $class . '">';
        $input .= '
             <label class="label" title="' . esc_attr($item['title']) . '">
                 <input value="' . htmlspecialchars($k) . '" class="STpanel-radio-input" type="radio" ' . $check . ' name="' . $layout_name . '" />
                 <img src="' . $image . '" alt =""/>
             </label>';
        $input .= '</div>';
    }
    echo $input;
    ?>
        <div class="clear"></div>
       </div><!-- layout -->
       
       <?php 
    // default sidebar
    $values['left_sidebar'] = $values['left_sidebar'] != '' ? $values['left_sidebar'] : 'sidebar_default_l';
    $values['right_sidebar'] = $values['right_sidebar'] != '' ? $values['right_sidebar'] : 'sidebar_default_r';
    ?>
       
        <div class="sidebar" <?php 
    echo $values['layout'] != 1 ? '' : ' style="display:none;" ';
    ?>
>
        <h4><?php 
    _e('Sidebar', 'smooththemes');
    ?>
</h4>
        <span  <?php 
    echo $values['layout'] == 3 || $values['layout'] == 4 ? ' ' : ' style="display:none;" ';
    ?>
 class="left_sidebar">
        <span class="chzn-select-lb"><?php 
    _e('Left sidebar', 'smooththemes');
    ?>
</span>
         <select name="<?php 
    echo $name . '[left_sidebar]';
    ?>
" class="chzn-select">
             <?php 
    foreach ($wp_registered_sidebars as $sb) {
        $selected = "";
        if ($values['left_sidebar'] == $sb['id']) {
            $selected = ' selected ="selected" ';
        }
        ?>
             <option value="<?php 
        echo esc_attr($sb['id']);
        ?>
" <?php 
        echo $selected;
        ?>
 ><?php 
        echo esc_html($sb['name']);
        ?>
</option>
             <?php 
    }
    ?>
          </select>
           <div class="clear"></div>
         </span>
          
          
         <span <?php 
    echo $values['layout'] == 2 || $values['layout'] == 4 ? ' ' : ' style="display:none;" ';
    ?>
 class="right_sidebar">
         <span class="chzn-select-lb"><?php 
    _e('Right sidebar', 'smooththemes');
    ?>
</span>
       
         <select name="<?php 
    echo $name . '[right_sidebar]';
    ?>
" class="chzn-select">
             <?php 
    foreach ($wp_registered_sidebars as $sb) {
        $selected = "";
        if ($values['right_sidebar'] == $sb['id']) {
            $selected = ' selected ="selected" ';
        }
        ?>
             <option value="<?php 
        echo esc_attr($sb['id']);
        ?>
" <?php 
        echo $selected;
        ?>
 ><?php 
        echo esc_html($sb['name']);
        ?>
</option>
             <?php 
    }
    ?>
         </select>
           <div class="clear"></div>
          </span>
          
             <div class="clear"></div>
        </div><!--  /. sidebar -->
        
      </div>  
        
        
    <?php 
}
 public static function get_page_options($post_id, $default = array(), $cache = true)
 {
     $cache_key = $post_id . '_' . self::PAGE_OPTIONS_NAME;
     $data = wp_cache_get($cache_key);
     if (!$cache || (!isset($data) || empty($data))) {
         $data = get_post_meta($post_id, self::PAGE_OPTIONS_NAME, true);
         $data = base64_decode($data);
         $data = maybe_unserialize($data);
         $data = stripslashes_deep($data);
         $data = wp_parse_args($data, $default);
         $data['st_default'] = false;
         if (!is_admin()) {
             $layout = false;
             // if is st-frame-work
             if (function_exists('st_get_setting')) {
                 $layout = st_get_setting('layout');
                 if ($layout == '') {
                     $layout = 'right-sidebar';
                 }
             }
             if ($layout && strtolower($data['layout']) == 'default') {
                 $data['layout'] = $layout;
                 $data['left_sidebar'] = st_get_setting('left_sidebar', 'sidebar_default');
                 $data['right_sidebar'] = st_get_setting('right_sidebar', 'sidebar_default');
                 $data['st_default'] = true;
             }
         }
         wp_cache_set($cache_key, $data);
     }
     return $data;
 }
示例#10
0
    echo esc_attr(st_get_setting("feedburner_urli"));
    ?>
">
     <input type="hidden" value="en_US" name="loc">
    <input type="submit" name="" value="<?php 
    _e('Subscribe', 'smooththemes');
    ?>
" class="btn btn_green">
</form>
<?php 
} else {
    ?>
    
<!-- Begin MailChimp Signup Form -->
<form id="subscribe_form" action="<?php 
    echo esc_url(st_get_setting('mailchimp_action', ''));
    ?>
" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
  <label for="mce-EMAIL"><?php 
    _e('Sign up to receive Special Offers:', 'smooththemes');
    ?>
&nbsp;&nbsp;</label>
 <input type="email" value="" name="EMAIL" class="email subs_email_input" id="mce-EMAIL" placeholder="<?php 
    _e('Enter your e-mail address', 'smooththemes');
    ?>
" required="true">
  <input type="submit" name="subscribe" value="<?php 
    _e('Subscribe', 'smooththemes');
    ?>
" class="btn btn_green">
</form>
示例#11
0
文件: titlebar.php 项目: alysilv/sila
<?php

$data['img'] = trim($data['img']);
if ($data['img'] == '' && $data['desc'] == '' && $data['title'] == '') {
    $data['title'] = st_get_setting('titlebar_title', '');
    $data['desc'] = st_get_setting('titlebar_desc', '');
    $data['img'] = st_get_setting('titlebar_img', '');
}
if ($data['img'] == '') {
    $data['img'] = ST_THEME_URL . '/assets/images/titlebar-bg.jpg';
}
?>

<div style="background:url('<?php 
echo esc_attr($data['img']);
?>
') no-repeat top center;" class="titlebar-outer-wrapper">
    <div class="container">
        <div class="row">
            <div class="twelve columns b0">
            <?php 
if ($data['title'] != "" || $data['desc'] != '') {
    ?>
                <div class="titlebar-title">
                  <?php 
    if ($data['title'] != "") {
        ?>
                    <h1><?php 
        echo esc_html($data['title']);
        ?>
</h1>
示例#12
0
文件: header.php 项目: alysilv/sila
            </div> <!-- END .top-bar-outer-wrapper -->
            <div class="header-outer-wrapper">
                <div class="header-wrapper container">
                    <div class="row">
                        <div class="twelve columns b0">
                            <div class="header-left left">
                                <div class="logo-wrapper">
                                    <h1><a href="<?php 
echo home_url();
?>
">
                                    <?php 
if (st_get_setting("site_logo") != '') {
    ?>
                                    <img src="<?php 
    echo esc_attr(st_get_setting("site_logo"));
    ?>
" alt="<?php 
    bloginfo('name');
    ?>
"/></a>
                                    <?php 
} else {
    ?>
                                     <span class="no-logo"><?php 
    bloginfo('name');
    ?>
</span>
                                    <?php 
}
?>
示例#13
0
?>
                                <?php 
if (st_get_setting("google_plus") != '') {
    ?>
                                <li class="social-google-plus social-gplus"><a href="<?php 
    echo esc_url(st_get_setting("google_plus"));
    ?>
"></a></li>
                                <?php 
}
?>
                                <?php 
if (st_get_setting("pinterest") != '') {
    ?>
                                <li class="social-pinterest"><a href="<?php 
    echo esc_url(st_get_setting("pinterest"));
    ?>
"></a></li>
                                <?php 
}
?>
                                <li class="search-form-li" ><a href="#" class="search-form-icon"><i class="icon-search"></i></a></li>
                            </ul>
                        
                            <form action="<?php 
echo home_url('/');
?>
" class="searchform top-search"  method="get" role="search">
                                <input type="text" class="s inputbox" placeholder="<?php 
_e('type and hit enter...', 'smooththemes');
?>
示例#14
0
 function st_enqueue_scripts()
 {
     if (!is_admin()) {
         wp_enqueue_script('modernizr', st_js('modernizr.js'));
         wp_enqueue_script('jquery', st_js('jquery.js'));
         wp_enqueue_script('st-loading', st_js('loading.js'), array('jquery'), '1.1');
         wp_enqueue_script('jquery.touchwipe.min', st_js('jquery.touchwipe.min.js'), array('jquery'), ST_VERSION, true);
         wp_enqueue_script('jquery.mousewheel.min', st_js('jquery.mousewheel.min.js'), array('jquery'), ST_VERSION, true);
         wp_enqueue_script('jquery.easing', st_js('jquery.easing.min.js'), array('jquery'), '1.3', true);
         wp_enqueue_script('ddsmoothmenu', st_js('ddsmoothmenu.js'), array('jquery'), '1.6', true);
         wp_enqueue_script('imagesLoaded', st_js('imagesLoaded.js'), array('jquery'), ST_VERSION, true);
         wp_enqueue_script('jquery.isotope', st_js('jquery.isotope.min.js'), array('jquery'), ST_VERSION, true);
         wp_enqueue_script('jquery.magnific-popup', st_js('jquery.magnific-popup.min.js'), array('jquery'), ST_VERSION, true);
         wp_enqueue_script('jquery.flexslider', st_js('jquery.flexslider.js'), array('jquery'), ST_VERSION, true);
         wp_enqueue_script('jquery.fitvids', st_js('jquery.fitvids.js'), array('jquery'), ST_VERSION, true);
         wp_enqueue_script('black-and-white', st_js('jquery.black-and-white.js'), array('jquery'), ST_VERSION, true);
         wp_enqueue_script('sly', st_js('sly.js'), array('jquery'), ST_VERSION, true);
         wp_enqueue_script('supersized', st_js('supersized.3.2.6.min.js'), array('jquery'), '3.2.6', true);
         wp_enqueue_script('supersized.shutter', st_js('supersized.shutter.min.js'), array('jquery'), ST_VERSION, true);
         // This slider called only in page template tpl-fullscreen.php
         if (is_page_template('tpl-fullscreen.php')) {
             /* Gallery Image Flow */
             wp_enqueue_script('image-flow', st_js('image-flow.js'), array('jquery'), ST_VERSION, true);
             /* Gallery Ken Burns Effect */
             wp_enqueue_script('kenburns', st_js('kenburns.js'), array('jquery'), ST_VERSION, true);
             /* Gallery Flip */
             wp_enqueue_script('jquery.flip.min', st_js('jquery.flip.min.js'), array('jquery'), ST_VERSION, true);
             wp_enqueue_script('st.jquery.flip', st_js('st.jquery.flip.js'), array('jquery'), ST_VERSION, true);
         }
         wp_enqueue_script('st_custom', st_js('exposed.js'), array('jquery'), ST_VERSION, true);
         if (is_singular() && get_option('thread_comments')) {
             wp_enqueue_script('comment-reply');
         }
         wp_localize_script('st_custom', 'FS', st_flex_js_settings());
         wp_localize_script('st_custom', 'ST', array('disable_header_floating' => st_get_setting("disable_header_floating", 'n')));
         wp_localize_script('st_custom', 'ajaxurl', admin_url('admin-ajax.php'));
     }
 }
示例#15
0
        
            <div class="footer-inner">
                <div class="footer-left">
                    <div class="supersized-action">
                        <a id="prevslide" class="load-item"></a>
                        <a id="play-button" class="load-item"><img id="pauseplay" alt="pause" src="<?php 
st_img('pause.png', true);
?>
"/></a>
                        <a id="nextslide" class="load-item"></a>
                        <div class="clear"></div>
                    </div>
                </div>
                <div class="footer-right">
                    <p><?php 
echo stripslashes(st_get_setting("footer_copyright"));
?>
</p>
                </div>
                <div class="clear"></div>
            </div>
        </footer>
    
    </div><!-- /.site-wrapper -->
    <?php 
wp_footer();
?>
    
 
</body>
</html>
示例#16
0
function st_titlebar_style()
{
    if (!current_theme_supports('st-titlebar')) {
        return false;
    }
    $options = array('img' => '', 'color' => '', 'position' => '', 'repeat' => '', 'attachment' => '', 'more_style' => '');
    $theme_settings = $page_settings = array();
    // default options from theme settings
    if (function_exists('st_get_setting')) {
        if (st_get_setting('titlebar_type') == 'defined') {
            $list_titlebar_bg = apply_filters('st_titlebar_list_bg', array());
            $defined = st_get_setting('titlebar_defined');
            $theme_settings = isset($list_titlebar_bg[$defined]) ? $list_titlebar_bg[$defined] : array();
        } else {
            foreach ($options as $k => $v) {
                $theme_settings[$k] = st_get_setting('titlebar_bg_' . $k);
            }
        }
    }
    // if is post
    if (is_singular() || is_page()) {
        global $post;
        $post_options = ST_Page_Builder::get_page_options($post->ID);
        if ($post_options['titlebar'] == 'custom') {
            foreach ($options as $k => $v) {
                $page_settings[$k] = $post_options['titlebar_bg_' . $k];
            }
            // load bg image
            if ($page_settings['img'] != '') {
                $image_attributes = wp_get_attachment_image_src($page_settings['img'], 'full');
                $page_settings['img'] = $image_attributes[0];
            }
        } else {
            if ($post_options['titlebar'] == 'defined') {
                $list_titlebar_bg = apply_filters('st_titlebar_list_bg', array());
                $defined = $post_options['titlebar_defined'];
                $page_settings = isset($list_titlebar_bg[$defined]) ? $list_titlebar_bg[$defined] : array();
            }
        }
    }
    $style = false;
    if (!empty($page_settings)) {
        $style = st_bg($page_settings);
        $more_style = apply_filters('st_titlebar_general_more', $style, $post->ID, $page_settings);
    } elseif (!empty($theme_settings)) {
        $style = st_bg($theme_settings);
        $more_style = apply_filters('st_titlebar_page_more', $style, $post->ID, $post_options);
    }
    if ($style) {
        ?>
    <style type="text/css">
        .layout-title{ <?php 
        echo $style;
        ?>
}<?php 
        echo $more_style != '' ? $more_style : '';
        ?>
    </style>
    <?php 
    }
}
示例#17
0
文件: footer.php 项目: alysilv/sila
echo stripcslashes(st_get_setting("footer_copyright"));
?>
                            </div>
                            <div class="copy-social right">
                                <ul class="footer-social">
                                   <?php 
$socials = array('twitter' => array('title' => __('Twitter', 'smooththemes'), 'icon' => 'social-twitter'), 'facebook' => array('title' => __('Facebook', 'smooththemes'), 'icon' => 'social-facebook'), 'google_plus' => array('title' => __('Google Plus', 'smooththemes'), 'icon' => 'social-google-plus'), 'youtube' => array('title' => __('Facebook', 'smooththemes'), 'icon' => 'social-youtube'));
foreach ($socials as $k => $v) {
    $link = st_get_setting($k);
    if ($link) {
        $socials[$k]['url'] = $link;
    } else {
        unset($socials[$k]);
    }
}
$skype = st_get_setting('skype');
if (count($socials) || $skype != '') {
    ?>
                                    <li class="stay_connected"><?php 
    _e('Stay Connected', 'smooththemes');
    ?>
</li>
                                    <?php 
    foreach ($socials as $social) {
        echo '<li class="' . $social['icon'] . '"><a target="_blank" href="' . esc_attr($social['url']) . '">' . esc_html($social['title']) . '</a></li>';
    }
    if ($skype != '') {
        echo '<li class="social-skype"><a href="skype:' . esc_attr($skype) . '?call">' . __('Skype', 'smooththemes') . '</a></li>';
    }
}
?>
示例#18
0
/**
* @return return the slider data for dunction st_slider
*/
function st_get_setup_post_slider_data($get_posts_args = array())
{
    if (empty($get_posts_args)) {
        return array();
    }
    $r = wp_parse_args($get_posts_args, array('cats' => '', 'numpost' => 5, 'exclude' => '', 'orderby' => 'ID', 'order' => 'DESC'));
    extract($r);
    if ($numpost <= 0) {
        $numpost = 5;
    }
    if (!is_array($cats)) {
        $cats = explode(',', $cats);
    }
    /**
     * @Since ver 1.3
     */
    $args = array('posts_per_page' => $numpost);
    if ($exclude != '') {
        $exclude = explode(',', $exclude);
        $args['post__not_in'] = $exclude;
    }
    if ($cats) {
        $args['category__in'] = $cats;
    }
    $args['meta_key'] = '_thumbnail_id';
    $args['meta_query'] = array(array('key' => '_thumbnail_id', 'value' => 0, 'type' => 'numeric', 'compare' => '>'));
    $args['orderby'] = $orderby;
    $args['order'] = $order;
    $args['post_status'] = 'publish';
    if (st_is_wpml()) {
        if (is_admin()) {
            // this function calling in admin page
            global $post;
            $lang_data = wpml_get_language_information($post->ID);
            //  echo var_dump($lang_data,$post->ID); die();
            $args['language'] = $lang_data['locale'];
        } else {
            $args['language'] = get_bloginfo('language');
        }
        $args['sippress_filters'] = true;
    }
    // echo var_dump($args);
    $new_query = new WP_Query($args);
    $myposts = $new_query->posts;
    $data['images'] = array();
    $data['meta'] = array();
    if (count($myposts)) {
        $i = 0;
        foreach ($myposts as $post) {
            $id = get_post_thumbnail_id($post->ID);
            if ($id > 0) {
                $data['images'][$i] = $id;
                $data['meta'][$i]['title'] = get_the_title($post->ID);
                $data['meta'][$i]['url'] = get_permalink($post->ID);
                $data['meta'][$i]['date'] = mysql2date('M j, Y', $post->post_date);
                $content = '';
                if (preg_match('/<!--more(.*?)?-->/', $post->post_content, $matches)) {
                    $content = explode($matches[0], $post->post_content, 2);
                    $content = $content[0];
                } else {
                    $content = st_get_substr(strip_tags($post->post_content), st_get_setting("limit_char", 70), '');
                }
                if ($content != '') {
                    $content .= st_excerpt_more();
                }
                $data['meta'][$i]['caption'] = $content;
                $i++;
            }
        }
    }
    return $data;
}
示例#19
0
<?php

$room_slug = trim(st_get_setting('post_room')) != '' ? trim(st_get_setting('post_room')) : 'room';
$portfolio_slug = trim(st_get_setting('post_portfolio')) != '' ? trim(st_get_setting('post_portfolio')) : 'portfolio';
$event_slug = trim(st_get_setting('post_event')) != '' ? trim(st_get_setting('post_event')) : 'event';
register_post_type('room', array('label' => _x('Room', 'smooththemes'), 'labels' => array('singular_name' => _x('Room', 'smooththemes'), 'menu_name' => _x('Rooms', 'smooththemes'), 'all_items' => _x('All Rooms', 'smooththemes'), 'add_new' => _x('Add Room', 'smooththemes'), 'add_new_item' => _x('Add new Room', 'smooththemes'), 'edit_item' => _x('Edit Room', 'smooththemes'), 'new_item' => _x('New Room', 'smooththemes'), 'view_item' => _x('View Room', 'smooththemes'), 'search_items' => _x('Search Rooms', 'smooththemes'), 'not_found' => _x('Not found', 'smooththemes'), 'not_found_in_trash' => _x('Not found in trash', 'smooththemes')), 'public' => true, 'show_ui' => true, 'rewrite' => array('slug' => $room_slug, 'with_front' => false), 'supports' => array('title', 'editor', 'thumbnail'), 'menu_position' => 6, 'can_export' => true));
register_post_type('room_service', array('label' => _x('Room Service', 'smooththemes'), 'labels' => array('singular_name' => _x('Room Service', 'smooththemes'), 'menu_name' => _x('Room  Services', 'smooththemes'), 'all_items' => _x('All Room Services', 'smooththemes'), 'add_new' => _x('Add Room Service', 'smooththemes'), 'add_new_item' => _x('Add new Room Service', 'smooththemes'), 'edit_item' => _x('Edit Room Service', 'smooththemes'), 'new_item' => _x('New Room Service', 'smooththemes'), 'view_item' => _x('View Room Service', 'smooththemes'), 'search_items' => _x('Search Room Services', 'smooththemes'), 'not_found' => _x('Not found', 'smooththemes'), 'not_found_in_trash' => _x('Not found in trash', 'smooththemes')), 'public' => false, 'show_ui' => true, 'show_in_nav_menus' => false, 'supports' => array('title', 'thumbnail'), 'menu_position' => 7, 'can_export' => true));
register_post_type('event', array('label' => _x('Event', 'smooththemes'), 'labels' => array('singular_name' => _x('Event', 'smooththemes'), 'menu_name' => _x('Events', 'smooththemes'), 'all_items' => _x('All Events', 'smooththemes'), 'add_new' => _x('Add Event', 'smooththemes'), 'add_new_item' => _x('Add new Event', 'smooththemes'), 'edit_item' => _x('Edit Event', 'smooththemes'), 'new_item' => _x('New Event', 'smooththemes'), 'view_item' => _x('View Event', 'smooththemes'), 'search_items' => _x('Search Events', 'smooththemes'), 'not_found' => _x('Not found', 'smooththemes'), 'not_found_in_trash' => _x('Not found in trash', 'smooththemes')), 'public' => true, 'show_ui' => true, 'rewrite' => array('slug' => $event_slug, 'with_front' => false), 'supports' => array('title', 'editor', 'thumbnail'), 'menu_position' => 20, 'can_export' => true));
register_post_type('portfolio', array('label' => _x('Portfolio', 'smooththemes'), 'labels' => array('singular_name' => _x('Portfolio', 'smooththemes'), 'menu_name' => _x('Portfolio', 'smooththemes'), 'all_items' => _x('All Portfolio', 'smooththemes'), 'add_new' => _x('Add Portfolio', 'smooththemes'), 'add_new_item' => _x('Add new Portfolio', 'smooththemes'), 'edit_item' => _x('Edit Portfolio', 'smooththemes'), 'new_item' => _x('New Portfolio', 'smooththemes'), 'view_item' => _x('View Portfolio', 'smooththemes'), 'search_items' => _x('Search Portfolio', 'smooththemes'), 'not_found' => _x('Not found', 'smooththemes'), 'not_found_in_trash' => _x('Not found in trash', 'smooththemes')), 'public' => true, 'show_ui' => true, 'rewrite' => array('slug' => $portfolio_slug, 'with_front' => false), 'supports' => array('title', 'editor', 'thumbnail', 'excerpt'), 'menu_position' => 20, 'can_export' => true));
register_post_type('gallery', array('label' => _x('Gallery', 'smooththemes'), 'labels' => array('singular_name' => _x('Gallery', 'smooththemes'), 'menu_name' => _x('Gallery', 'smooththemes'), 'all_items' => _x('All Galleries', 'smooththemes'), 'add_new' => _x('Add new', 'smooththemes'), 'add_new_item' => _x('Add new', 'smooththemes'), 'edit_item' => _x('Edit Gallery', 'smooththemes'), 'new_item' => _x('New Gallery', 'smooththemes'), 'view_item' => _x('View Gallery', 'smooththemes'), 'search_items' => _x('Search Galleries', 'smooththemes'), 'not_found' => _x('Not found', 'smooththemes'), 'not_found_in_trash' => _x('Not found in trash', 'smooththemes')), 'public' => true, 'show_ui' => true, 'supports' => array('title', 'editor', 'thumbnail'), 'menu_position' => 11, 'can_export' => true));
// flush_rewrite_rules();
示例#20
0
文件: titlebar.php 项目: alysilv/sila
    global $post;
    $st_page_builder = get_page_builder_options($post->ID);
    if (empty($st_page_builder)) {
        $st_page_builder['show_title'] = 1;
    } else {
        if (!isset($st_page_builder['show_title'])) {
            $st_page_builder['show_title'] = '';
        }
    }
    st_the_slider($st_page_builder, false, true);
} elseif (is_singular('post') || is_tax() || is_category() || is_tag() || (is_home() || is_front_page()) && !is_page()) {
    if (st_get_setting('show_blog_titlebar', 'y') != 'n') {
        $st_page_builder = array();
        $st_page_builder['show_top_slider'] = 1;
        $st_page_builder['slider_type'] = 'titlebar';
        $st_page_builder['titlebar']['title'] = st_get_setting('blog_titlebar', '');
        $st_page_builder['titlebar']['desc'] = st_get_setting('blog_titlebar_desc', '');
        $st_page_builder['titlebar']['img'] = st_get_setting('blog_titlebar_img', '');
        $st_page_builder['slider_full_w'] = 1;
        st_the_slider($st_page_builder, false, true);
    }
} else {
    $st_page_builder = array();
    $st_page_builder['show_top_slider'] = 1;
    $st_page_builder['slider_type'] = 'titlebar';
    $st_page_builder['titlebar']['title'] = '';
    $st_page_builder['titlebar']['desc'] = '';
    $st_page_builder['titlebar']['img'] = '';
    $st_page_builder['slider_full_w'] = 1;
    st_the_slider($st_page_builder, false, true);
}
示例#21
0
<?php

/**
 * register Sidebars for theme
 */
register_sidebar(array('name' => 'Default Sidebar right', 'id' => 'sidebar_default_r', 'description' => 'This is default sidebar widget that will displayed on all pages.', 'before_widget' => '<div id="%1$s" class="widget-container %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
register_sidebar(array('name' => 'Default Sidebar left', 'id' => 'sidebar_default_l', 'description' => 'This is default sidebar widget that will displayed on all pages.', 'before_widget' => '<div id="%1$s" class="widget-container %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
$st_sidebars = st_get_setting("sidebars", array());
if (!is_array($st_sidebars)) {
    $st_sidebars = (array) $st_sidebars;
}
foreach ($st_sidebars as $sidebar) {
    register_sidebar(array('name' => $sidebar['title'], 'id' => $sidebar['id'], 'description' => 'This sidebar is displayed on the "' . esc_html($sidebar['title']) . '".', 'before_widget' => '<div id="%1$s" class="widget-container sb' . $sidebar['id'] . ' ' . $sidebar['id'] . ' %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>'));
}
示例#22
0
function background_slider($dt, $show_caption = false)
{
    global $post;
    $data = $dt['thumbnails'];
    $images = $data['images'];
    $metas = $data['meta'];
    $sliders = array();
    if (count($images)) {
        /* Get Data */
        $i = 0;
        foreach ($images as $k => $thumb_id) {
            $meta = $metas[$k];
            $thumb_image_url = wp_get_attachment_image_src($thumb_id, 'st_large');
            $thumb_image_url = $thumb_image_url[0];
            $full_image_url = wp_get_attachment_image_src($thumb_id, 'full');
            $full_image_url = $full_image_url[0];
            $thumbnail_image_url = wp_get_attachment_image_src($thumb_id, 'thumbnail');
            $thumbnail_image_url = $thumbnail_image_url[0];
            $images['src_large'][$i] = $thumb_image_url;
            $images['src_thumbnail'][$i] = $thumbnail_image_url;
            $images['title'][$i] = isset($meta['title']) ? stripslashes($meta['title']) : '';
            $images['caption'][$i] = $meta['caption'] != '' ? '<p>' . stripslashes($meta['caption']) . '</p>' : '';
            $images['url'][$i] = $meta['url'];
            $images['src_full'][$i] = $full_image_url;
            $i++;
        }
        if (isset($dt['type_slider'])) {
            switch ($dt['type_slider']) {
                case 'fixed_slider':
                    /* Start Gallery Fixed Slider */
                    ?>

                <script type="text/javascript">

                    /* <![CDATA[ */

                    var gFixedHeight = true;

                    var gFixedHeightSetting = <?php 
                    echo json_encode(st_fixed_height_js_settings());
                    ?>
;

                    /* ]]> */

                </script>

                <!-- Begin Gallery Flex Slider -->

                <div class="fw-flexslider-wrap t35">

                    <div class="fw-slider-wrap">

                        <div class="fw-flexslider fws" id="slider" sync="#carousel">

                            <ul class="slides">

                                <?php 
                    foreach ($images['src_full'] as $k => $v) {
                        ?>

                                    <li>

                                        <div class="slider-item">

                                            <div class="item-cell">

                                                <a class="lightbox" href="<?php 
                        echo $v;
                        ?>
"><img alt="" src="<?php 
                        echo $images['src_large'][$k];
                        ?>
"/></a>

                                            </div>

                                        </div>

                                    </li>

                                <?php 
                    }
                    ?>

                            </ul>

                        </div>

                    </div>

                    <div class="fw-carousel-wrap">

                        <div id="carousel" class="fw-carousel" asNavFor="#slider">

                            <ul class="slides">

                                <?php 
                    foreach ($images['src_thumbnail'] as $k => $v) {
                        ?>

                                    <li>

                                        <div class="slider-item">

                                            <img alt="" src="<?php 
                        echo $v;
                        ?>
"/>

                                        </div>

                                    </li>

                                <?php 
                    }
                    ?>

                            </ul>

                        </div>

                    </div>

                    <div class="clear"></div>

                </div>

                <!-- End Gallery Flex Slider -->

            <?php 
                    /* End Gallery Fixed Slider */
                    break;
                case 'image_flow':
                    /* Start Gallery Image Flow */
                    ?>

                <script type="text/javascript">
                    /* <![CDATA[ */
                    var gImageFlow = true;
                    var gImageFlowURL = '<?php 
                    echo ST_THEME_URL . 'image-flow-xml.php?id=' . @$post->ID;
                    ?>
';
                    var gImageFlowSetting = <?php 
                    echo json_encode(st_image_flow_js_settings());
                    ?>
;
                    /* ]]> */
                </script>
                <!-- Begin Gallery Image Flow -->
                <div class="fw-imageflow-wrap t35">

                    <div id="imageFlow" class="imageflow">

                        <div class="text">

                            <div class="title">
                                <div class="loading-icon"></div>
                            </div>

                            <div class="legend"></div>

                        </div>

                        <div class="scrollbar">

                            <img class="track" src="<?php 
                    st_img('dark_slider_bg.png', true);
                    ?>
" alt=""/>

                            <img class="arrow-left" src="<?php 
                    st_img('sl.gif', true);
                    ?>
" alt=""/>

                            <img class="arrow-right" src="<?php 
                    st_img('sr.gif', true);
                    ?>
" alt=""/>

                            <img class="bar" src="<?php 
                    st_img('white_slider_handle.png', true);
                    ?>
" alt=""/>

                        </div>

                    </div>

                </div>

                <!-- End Gallery Image Flow -->

            <?php 
                    /* End Gallery Image Flow */
                    break;
                case 'gallery_kenburns':
                    /* Start Gallery Kenburns */
                    ?>

                <script type="text/javascript">

                    /* <![CDATA[ */

                    var gKenBurnsEffect = true;

                    var gDataKenBurnsEffect = [<?php 
                    echo '\'' . implode('\',\'', $images['src_full']) . '\'';
                    ?>
];

                    var gKenBurnsSetting = <?php 
                    echo json_encode(st_kenburns_js_settings());
                    ?>
;

                    /* ]]> */

                </script>



                <div id="kenburns_overlay"></div>

                <canvas id="kenburns">

                    <p><?php 
                    _e('Your browser doesn\'t support canvas!', 'smooththemes');
                    ?>
</p>

                </canvas>

            <?php 
                    /* End Gallery Kenburns */
                    break;
                case 'gallery_flip':
                    /* Start Gallery Flip */
                    ?>

                <script type="text/javascript">

                    /* <![CDATA[ */

                    var gGalleryFlip = true;

                    var gGalleryFlipSetting = <?php 
                    echo json_encode(st_flip_js_settings());
                    ?>
;

                    /* ]]> */

                </script>

                <!-- Begin Gallery Flip -->

                <div class="fw-gallery-flip-wrap">

                    <div id="tf_loading" class="tf_loading"></div>

                    <div id="tf_bg" class="tf_bg">

                        <?php 
                    foreach ($images['src_full'] as $k => $v) {
                        ?>

                            <img src="<?php 
                        echo $v;
                        ?>
" alt="" longdesc="<?php 
                        echo $images['src_thumbnail'][$k];
                        ?>
"/>

                        <?php 
                    }
                    ?>

                    </div>

                    <div id="tf_thumbs" class="tf_thumbs">

                        <span id="tf_zoom" class="tf_zoom"></span>

                        <img src="<?php 
                    echo $images['src_thumbnail'][0];
                    ?>
" alt=""/>

                    </div>


                    <div id="tf_next" class="tf_next"></div>

                    <div id="tf_prev" class="tf_prev"></div>

                </div>

                <!-- End Gallery Flip -->

            <?php 
                    /* Start Gallery Flip */
                    break;
                default:
                    /* Start Supersize Slider */
                    foreach ($images['src_full'] as $k => $v) {
                        $item = array();
                        $item['image'] = $v;
                        $item['title'] = '';
                        if ($show_caption) {
                            if ($images['title'][$k] != '' || $images['caption'][$k] != '') {
                                if ($images['url'][$k] != '' && $images['title'][$k] != '') {
                                    $item['title'] = '<a href="' . $images['url'][$k] . '">' . esc_html($images['title'][$k]) . '</a>';
                                } else {
                                    if ($images['title'][$k] != '') {
                                        $item['title'] = esc_html($images['title'][$k]);
                                    }
                                }
                                if ($images['caption'] != '') {
                                    $images['caption'][$k] = balanceTags($images['caption'][$k]);
                                    $item['title'] .= $images['caption'][$k];
                                }
                            }
                        }
                        $sliders[] = $item;
                        //var_dump($sliders);
                    }
                    $slider_settings = array();
                    $slider_settings['slideshow'] = st_get_setting("fsc_slideshow") == 'n' ? 0 : 1;
                    $slider_settings['autoplay'] = st_get_setting("fsc_autoplay") == 'n' ? 0 : 1;
                    $slider_settings['slide_interval'] = intval(st_get_setting("fsc_interval")) > 0 ? intval(st_get_setting("fsc_interval")) : 6000;
                    $slider_settings['transition_speed'] = intval(st_get_setting("fsc_transition_speed")) > 0 ? intval(st_get_setting("fsc_transition_speed")) : 800;
                    $slider_settings['path'] = st_img('');
                    ?>
                <script type="text/javascript">
                    /* <![CDATA[ */
                    var gFullSliderSettings = <?php 
                    echo json_encode($slider_settings);
                    ?>
;

                    var gFullSliderData = <?php 
                    echo json_encode($sliders);
                    ?>
;
                    /* ]]> */
                </script>

            <?php 
                    if ($show_caption) {
                        echo ' <div id="slidecaption" ></div> ';
                    }
                    /* End Supersize Slider */
            }
        }
    }
}