Example #1
0
 public static function tpl_include($template)
 {
     //checks to see if mobile theme is available
     $mobile_themes = false;
     if (file_exists(get_stylesheet_directory() . '/mobile.php') or file_exists(get_template_directory() . '/mobile.php')) {
         $mobile_themes = true;
     }
     //checks to see if mobile-phone theme is available
     $mobile_phone_themes = false;
     if (file_exists(get_stylesheet_directory() . '/mobile-phone.php') or file_exists(get_template_directory() . '/mobile-phone.php')) {
         $mobile_phone_themes = true;
     }
     if (cwp::theme_settings('offline') == 1 and !current_user_can('manage_options')) {
         self::$main_tpl = get_stylesheet_directory() . '/offline.php';
     } else {
         self::$main_tpl = $template;
     }
     self::$base_tpl = substr(basename(self::$main_tpl), 0, -4);
     if ('index' == self::$base_tpl) {
         self::$base_tpl = false;
     }
     /**
      *  check to seee if a mobile templaate exists in stylesheet dir and load
      *  to disable mobile themes create a child theme without a mobile template
      */
     if ($mobile_themes and mod_mobile::detect()->isTablet()) {
         /*
          * theme/tpl/layout/file.php -  theme/tpl/index.php
          */
         $templates = array('tpl/mobile/mobile.php');
         if (self::$base_tpl) {
             //twitter bootstrap themes
             array_unshift($templates, sprintf('tpl/mobile/tpl-mobile-%s.php', self::$base_tpl));
         }
     } elseif ($mobile_phone_themes and mod_mobile::detect()->isPhone()) {
         /*
          * theme/tpl/layout/file.php -  theme/tpl/index.php
          */
         $templates = array('tpl/mobile/phone.php');
         if (self::$base_tpl) {
             //twitter bootstrap themes
             array_unshift($templates, sprintf('tpl/mobile/tpl-phone-%s.php', self::$base_tpl));
         }
     } else {
         /*
          * theme/tpl/layout/file.php -  theme/tpl/index.php
          */
         $templates = array('tpl/themes/tpl-index.php', 'tpl/layout/tpl-index.php', 'tpl/layout/index.php');
         if (self::$base_tpl) {
             //foundation themes  - may remove foundation entirely
             //array_unshift($templates, sprintf('tpl/sample/tpl-%s.php', self::$base_tpl));
             array_unshift($templates, sprintf('tpl/layout/tpl-%s.php', self::$base_tpl));
             array_unshift($templates, sprintf('tpl/themes/tpl-%s.php', self::$base_tpl));
         }
     }
     //return locate_template($templates,true);
     self::locate_tpl($templates, null, true);
     // return self::locate_tpl($templates);
 }
Example #2
0
 public static function config($array = array(), $itemselector = '.grid_3', $id = 'masonry')
 {
     extract($array);
     $path = cwp::config('config', 'masonry');
     if ($path) {
         include_once CM_PATH . '/masonry/config.php';
     } else {
         return 'Masonry file not found';
     }
 }
function bj_theme_setup()
{
    /*
     * footer widgets
     */
    cwp::add_widget('Sidebar', 'sidebar', 'Top sidebar widget');
    cwp::add_widget('Secondary Sidebar', 'secondary-sidebar', 'Themes Secondary Sidebar');
    cwp::add_widget('info 1', 'info-1', 'Display widgets in the first footer box');
    cwp::add_widget('info 2', 'info-2', 'Display widgets in the second footer box');
    cwp::add_widget('info 3', 'info-3', 'Display widgets in the third footer box');
    cwp::add_widget('info 4', 'info-4', 'Display widgets in the fourth footer box');
    cwp::add_widget('info 5', 'info-5', 'Display widgets in the fifth footer box');
    cwp::add_widget('Widget Page', 'widget-page', 'Display widgets on the widget-page tpl');
    cwp::register_sidebar('404 Page', '404-page', 'Display widgets on the 404-page tpl');
    /*
     * *********** Custom images sizes and post media manage integration ************
     */
}
Example #4
0
            <div class="six columns">
                <!-- class content -->
                <hgroup>
                    <h1 id="site-title"><span>
                            <a href="<?php 
echo home_url('/');
?>
" title="<?php 
echo esc_attr(get_bloginfo('name', 'display'));
?>
" rel="home">
                                <?php 
//bloginfo('name');
?>
                                <img src="<?php 
echo cwp::logo();
?>
" alt="<?php 
bloginfo('name');
?>
" />
                            </a></span>
                    </h1>
                </hgroup>
            </div>
            <div class="six columns">
                <div class="social">
                    <a href="<?php 
the_author_meta('twitter', cwp_themeadmin());
?>
">
Example #5
0
 public static function bm_sc_mshot($attributes, $content = '', $code = '')
 {
     extract(shortcode_atts(array('url' => '', 'width' => 250, 'target' => null), $attributes));
     $imageUrl = cwp::bm_mshot($url, $width);
     if ($imageUrl == '') {
         return '';
     } else {
         $image = '<img src="' . $imageUrl . '" alt="' . $url . '" width="' . $width . '"/>';
         return '<div class="browsershot mshot"><a href="' . $url . '" target="' . $target . '">' . $image . '</a></div>';
     }
 }
Example #6
0

    <?php 
/**
 * Twitter
 *
 */
?>
                <tr valign="top"><th scope="row"><?php 
_e('Twitter Profile Widget', 'corewp');
?>
</th>
                    <td>
                        <p>
                            <textarea id="cwp_theme_options[twitterwidget]" cols="100" rows="10" name="cwp_theme_options[twitterwidget]"> <?php 
echo esc_textarea(cwp::theme_options('twitterwidget'));
?>
</textarea>
                        </p>

                        <label class="description" for="cwp_theme_options[twitterwidget]"><?php 
_e('Paste your Twitter Profile Widget page code
                            <a href="https://twitter.com/about/resources/widgets/widget_profile" target="_blank">
                            https://twitter.com/about/resources/widgets/widget_profile</a>', 'corewp');
?>
</label>
                    </td>
                </tr>


    }
    ?>

    <?php 
    /* Start the Loop */
    ?>
    <?php 
    while (have_posts()) {
        the_post();
        ?>

        <?php 
        //get_template_part('content', 'search');
        ?>
      <?php 
        cwp::get_tpl_content('search');
        ?>


    <?php 
    }
    ?>

    <?php 
    /* Display navigation to next/previous pages when applicable */
    ?>
    <?php 
    if ($wp_query->max_num_pages > 1) {
        ?>
        <nav id="nav-below">
            <h1 class="section-heading"><?php 
Example #8
0
{
}
function tp_footer()
{
}
get_header();
cwp_layout::theme_header();
//cwp::get_theme_header();
?>
<section id="content">
    <div class="container"><!-- container -->
        <div class="row"><!-- container -->
            <div class="eight columns"><!-- container -->
                <section id="articles">
                    <?php 
cwp::get_tpl();
?>
                </section>
            </div>
            <div class="four columns"><!-- container -->
                <section id="sidebar">
                    <?php 
get_sidebar();
?>
                </section><!-- #sidebar -->
            </div>
            <div class="clear">Cleared</div>
        </div>
    </div>
    <div class="clear">Cleared</div>
</section>
Example #9
0
?>
"/>
        <link rel="stylesheet" href="<?php 
echo cwp::locate_in_library('base-style.css');
?>
" />
        <link rel="stylesheet" href="<?php 
echo cwp::locate_in_library('stylesheet.css', 'fonts/socialicons');
?>
"/>
        <link rel="stylesheet" href="<?php 
echo cwp::locate_in_library('stylesheet.css', 'fonts/novecento');
?>
"/>
        <link rel="stylesheet" href="<?php 
echo cwp::locate_in_library('font-awesome.css', 'bootstrap/css');
?>
"/>
	<!--[if lt IE 9]>
		<link rel="stylesheet" href="<?php 
echo get_template_directory_uri();
?>
/foundation/stylesheets/ie.css">
	<![endif]-->

	<!-- IE Fix for HTML5 Tags -->
	<!--[if lt IE 9]>
		<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->

<!--	<script src="<?php 
Example #10
0
?>
"/>
        <link rel="stylesheet" href="<?php 
echo cwp::locate_in_library('stylesheet.css', 'fonts/Droid-Sans');
?>
"/>
        <link rel="stylesheet" href="<?php 
echo cwp::locate_in_library('stylesheet.css', 'fonts/Droid-Serif');
?>
"/>
        <link rel="stylesheet" href="<?php 
echo cwp::locate_in_library('stylesheet.css', 'fonts/web-symbols');
?>
"/>
        <link rel="stylesheet" href="<?php 
echo cwp::locate_in_library('stylesheet.css', 'fonts/Entypo');
?>
"/>


	<!-- IE Fix for HTML5 Tags -->
	<!--[if lt IE 9]>
		<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->

<!--	<script src="<?php 
echo get_template_directory_uri();
?>
/foundation/javascripts/jquery-1.5.1.min.js"></script>-->

         <!-- theme stylesheet last - cascading elements -->
Example #11
0
 public function scripts()
 {
     //wp_register_script('nivo-slider',get_template_directory_uri().'/library/nivo-slider/jquery.nivo.slider.pack.js',array('jquery'));
     wp_register_script('nivo-slider', cwp::locate_in_library('jquery.nivo.slider.pack.js', 'nivo'), array('jquery'));
     //wp_register_style('nivo-style', get_template_directory_uri().'/library/nivo-slider/');
     wp_register_style('nivo-style', cwp::locate_in_library('nivo-slider.css', 'nivo'));
     //wp_register_style('nivo-default', get_template_directory_uri()."/library/nivo-slider/themes/default/default.css",array('nivo-style'));
     wp_register_style('nivo-default', cwp::locate_in_library('default.css', 'nivo/themes/default'));
     //wp_register_style('nivo-pascal', get_template_directory_uri()."/library/nivo-slider/themes/pascal/pascal.css",array('nivo-style'));
     //wp_register_style('nivo-orman', get_template_directory_uri()."/library/nivo-slider/themes/orman/orman.css",array('nivo-style'));
     wp_enqueue_script('nivo-slider');
     wp_enqueue_style('nivo-style');
 }
Example #12
0
            <div class="six columns">
                <!-- class content -->
                <hgroup>
                    <h1 id="site-title"><span>
                            <a href="<?php 
echo home_url('/');
?>
" title="<?php 
echo esc_attr(get_bloginfo('name', 'display'));
?>
" rel="home">
                                <?php 
//bloginfo('name');
?>
                                <img src="<?php 
echo cwp::logo('cp-logo-round.png');
?>
" alt="<?php 
bloginfo('name');
?>
" />
                         </a></span>
                   </h1>
                </hgroup>
            </div>
            <div class="six columns">
                menu

                <!-- ####column-end#### -->
            </div>
            <!-- ###### -->
Example #13
0
?>
">
        <link rel="stylesheet" href="<?php 
echo cwp::locate_in_library('ui-stylesheet.css');
?>
">
        <link rel="stylesheet" href="<?php 
echo cwp::locate_in_library('base-style.css');
?>
">
        <link rel="stylesheet" href="<?php 
echo cwp::locate_in_library('stylesheet.css', 'fonts/pictograms');
?>
">
        <link rel="stylesheet" href="<?php 
echo cwp::locate_in_library('stylesheet.css', 'fonts/socialico-web');
?>
">

	<!--[if lt IE 9]>
		<link rel="stylesheet" href="<?php 
echo get_template_directory_uri();
?>
/foundation/stylesheets/ie.css">
	<![endif]-->

	<!-- IE Fix for HTML5 Tags -->
	<!--[if lt IE 9]>
		<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
Example #14
0
function cwp_switch_theme()
{
    //update_option('cwp_last_theme', "theme switched reactivated");
    if (!cwp::theme_options('saveoptions') and cwp::theme_options('saveoptions') == 0) {
        delete_option('cwp_theme_options');
    }
}
Example #15
0
<?php

/**
 * @package WordPress
 * @subpackage Core-SF
 */
?>
<!--foundation sctipts-->
<?php 
wp_footer();
?>
<script type='text/javascript' src="<?php 
echo cwp::locate_in_library('foundation.js', 'foundation/javascripts');
?>
"></script>
<script type='text/javascript' src="<?php 
echo cwp::locate_in_library('app.js', 'foundation/javascripts');
?>
"></script>
</body>
</html>
}
cwp_layout::header();
cwp_layout::theme_header();
//cwp::get_theme_header();
?>
<section id="content">
    <div class="container"><!-- container -->
        <div class="row"><!-- container -->
            <div class="eight columns"><!-- container -->
                <section id="articles">
                    <?php 
cwp_layout::main_tpl();
?>
                </section>
            </div>
            <div class="four columns"><!-- container -->
                <section id="sidebar">
                    <?php 
get_sidebar();
?>
                </section><!-- #sidebar -->
            </div>
            <div class="clear">Cleared</div>
        </div>
    </div>
    <div class="clear">Cleared</div>
</section>
<?php 
cwp_layout::theme_footer();
cwp::get_theme_footer();
get_footer();
Example #17
0
<?php

if (has_post_thumbnail()) {
    ?>
    <div class="grid-thumbnail">
        <?php 
    the_post_thumbnail('home-thumb');
    ?>
        <div class="clear">Cleared</div>
    </div>
<?php 
}
?>
<h3>
    <a href="<?php 
the_permalink();
?>
" title="<?php 
printf(esc_attr__('Permalink to %s', 'toolbox'), the_title_attribute('echo=0'));
?>
" rel="bookmark"><?php 
the_title();
?>
    </a>
</h3>
<?php 
cwp::excerpt();
add_theme_support('automatic-feed-links');
//add_editor_style();
//cwp::theme_images(); //adds  image sizes slideshow-[720,960,1200,1560], icon-[40,60,100]
add_image_size('icon-60', 60, 60, true);
add_image_size('icon-100', 100, 100, true);
add_image_size('icon-40', 40, 40, true);
/*
 * footer widgets
 */
cwp::add_widget('info 1', 'info-1', 'Display widgets in the first footer box');
cwp::add_widget('info 2', 'info-2', 'Display widgets in the second footer box');
cwp::add_widget('info 3', 'info-3', 'Display widgets in the third footer box');
cwp::add_widget('info 4', 'info-4', 'Display widgets in the fourth footer box');
cwp::add_widget('info 5', 'info-5', 'Display widgets in the fifth footer box');
cwp::add_widget('Widget Page', 'widget-page', 'Display widgets on the widget-page tpl');
cwp::add_widget('404 Page', '404-page', 'Display widgets on the 404-page tpl');
/**
 * footer
 */
add_action('wp_footer', 'theme_footer');
function theme_footer()
{
}
/*
 * add thumbnails to editior list
 */
core_admin::post_list_thumbs();
/*
 * add post style to TinyMCS editor
 */
core_admin::editor_style();
$cwp_types = new theme_content();
$cwp_types->feedback();
theme_content::add()->article();
theme_content::add()->faq();
/**
 * *************customisations**************************************************
 */
//add more optoion to user profile
cwp_social::contact_info();
//post gallery rotator checkbox
cwp_gallery::gallery_rotator();
core_admin::remove_wp_adminbar_logo();
/**
 * ***********grab browser screenshots shortcode********************************
 */
cwp::browsershots();
/**
 * display gallery petabox image gallery metabox
 */
if (function_exists('be_gallery_metabox')) {
    function be_gallery_types()
    {
        $post = array('post', 'page', 'cwp_theme');
        return $post;
    }
    function be_gallery_icon()
    {
        return 'icon-60';
    }
    add_filter('be_gallery_metabox_post_types', 'be_gallery_types', 10, 2);
    add_filter('be_gallery_metabox_image_size', 'be_gallery_icon', 10, 2);
Example #20
0
/**
 * @package WordPress
 * @subpackage Core-WP
 * @author shawnsandy
 */
/*
 Template Name: Loubon Orders
*/
require_once CWP_PATH . '/includes/recaptchalib.php';
$o_validate = null;
$publickey = "6LcO8ccSAAAAAMCAW1sLco-sU7v8oGFrwFnEvsJE";
// you got this from the signup page
$o_cpatcha = cwp::recaptcha($publickey);
$privatekey = "6LcO8ccSAAAAAPphVbpBLOnL_kRlHhLXzoyx0mf5";
$o_validate = cwp::recaptcha_valid($privatekey);
//if (isset($_POST["recaptcha_challenge_field"]) AND isset($_POST["recaptcha_response_field"])):
//    $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
//    if (!$resp->is_valid) {
//        // What happens when the CAPTCHA was entered incorrectly
//        die("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
//                "(reCAPTCHA said: " . $resp->error . ")");
//    } else {
//
//       return $o_validate = true;
//    }
//endif;
add_action('wp_footer', 'lo_header');
function lo_header()
{
    ?>
Example #21
0
    /**
     * FB html5 share
     * Include the JavaScript SDK on your page once, ideally right after the opening <body> tag.
     * @param type $app_id
     * @return html/js
     */
    public function fb_script()
    {
        $app_id = cwp::theme_options('fbappid');
        if ($app_id and !empty($app_id)) {
            ?>
                    <div id="fb-root"></div>
                    <script>(function(d, s, id) {
                        var js, fjs = d.getElementsByTagName(s)[0];
                        if (d.getElementById(id)) return;
                        js = d.createElement(s); js.id = id;
                        js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=<?php 
            echo $app_id;
            ?>
";
                        fjs.parentNode.insertBefore(js, fjs);
                    }(document, 'script', 'facebook-jssdk'));
                    </script>
            <?php 
        }
    }
Example #22
0
    </nav><!-- #nav-above -->
<?php 
}
?>

<?php 
/* Start the Loop */
while (have_posts()) {
    the_post();
    ?>

    <?php 
    //get_template_part( 'content', get_post_format() );
    ?>
    <?php 
    cwp::get_tpl_content(get_post_format() ? get_post_format() : 'general');
    ?>

<?php 
}
?>

<?php 
/* Display navigation to next/previous pages when applicable */
if ($wp_query->max_num_pages > 1) {
    ?>
    <nav id="nav-below">
        <h1 class="section-heading"><?php 
    _e('Post navigation', 'toolbox');
    ?>
</h1>
Example #23
0
    the_permalink();
    ?>
" title="<?php 
    printf(esc_attr__('Permalink to %s', 'toolbox'), the_title_attribute('echo=0'));
    ?>
" rel="bookmark">
                <?php 
    cwp::fluid_img('home-thumb', 100);
    ?>
</a>
            <div class="clear">Cleared</div>
        </div>
    <?php 
}
?>
    <div class="contents">

        <?php 
cwp::excerpt(200);
?>
        <div class="post-meta">
            <?php 
//the_time('F j, Y');
the_category('/');
echo " (" . core_functions::time_ago() . ")";
?>
            <!-- class content -->
        </div>
   
    </div>
Example #24
0
<?php

/**
 * @package WordPress
 * @subpackage Toolbox-Core
 *
 */
the_post();
?>

<?php 
//get_template_part('content', 'page');
?>
<section id="page-content">
 <?php 
cwp::get_tpl_content('page');
?>
</section>


<?php 
comments_template('', true);