Ejemplo n.º 1
0
 public function __construct()
 {
     TT_ENQUEUE::$enabled = FALSE;
     // Actions
     add_action('after_setup_theme', array($this, 'theme_setup'));
     add_action('wp_head', array($this, 'theme_favicon'));
     add_action('wp_enqueue_scripts', array($this, 'enqueue_goods'));
     add_action('wp_enqueue_scripts', array($this, 'request_js'), 99);
     add_action('wp_enqueue_scripts', array($this, 'theme_custom_css'), 99);
     add_action('tt_theme_header', array($this, 'header_view'));
     add_action('tt_footer', array($this, 'footer_content'));
     //add_action( 'tt_page_meta', array( $this, 'page_meta_view' ) );
     add_action('tt_content', array($this, 'create_pages_contents'));
     add_action('tt_before_pages', array($this, 'before_pages'));
     add_action('tt_after_pages', array($this, 'after_pages'));
     add_action('wp', array($this, 'detect_shortcode'));
     add_action('widgets_init', array($this, 'sidebar_init'));
     add_action('wp_ajax_tt_contact_form', array($this, 'tt_contact_form'));
     add_action('wp_ajax_nopriv_tt_contact_form', array($this, 'tt_contact_form'));
     if (is_admin()) {
         add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_goods'), 10, 1);
         add_action('load-post.php', array($this, 'generate_custom_meta'));
         add_action('load-post-new.php', array($this, 'generate_custom_meta'));
     }
     // Filters
     add_filter('get_search_form', array($this, 'filter_search_form'));
     add_filter('excerpt_more', array($this, 'read_more_link'));
     add_filter('get_the_excerpt', array($this, 'read_more_link_excerpt'));
     add_filter('script_loader_tag', array($this, 'add_id_to_script'), 10, 2);
     // Widgets
     register_widget('Recent_posts');
     // Activate Visual Composer
     $this->start_visual_composer();
 }
/***********************************************************************************************/
/*  Register Plugins */
/***********************************************************************************************/
if (is_admin() && current_user_can('install_themes')) {
    require_once get_template_directory() . '/plugins/tgm-plugin-activation/register-plugins.php';
}
/***********************************************************************************************/
/* Load JS and CSS Files - done with TT_ENQUEUE */
/***********************************************************************************************/
/***********************************************************************************************/
/* Google fonts + Fonts changer */
/***********************************************************************************************/
TT_ENQUEUE::$base_gfonts = array('://fonts.googleapis.com/css?family=Roboto:100,400,400italic,300,300italic,700,700italic,900');
TT_ENQUEUE::$gfont_changer = array(_go('logo_text_font'), _go('main_content_text_font'), _go('sidebar_text_font'), _go('menu_text_font'));
TT_ENQUEUE::add_css(array('//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css'));
TT_ENQUEUE::add_js(array('http://w.sharethis.com/button/buttons.js'));
/***********************************************************************************************/
/* Custom CSS */
/***********************************************************************************************/
add_action('wp_enqueue_scripts', 'tesla_custom_css', 99);
function tesla_custom_css()
{
    $custom_css = _go('custom_css') ? _go('custom_css') : '';
    wp_add_inline_style('tt-main-style', $custom_css);
}
add_action('wp_enqueue_scripts', 'tt_style_changers', 99);
function tt_style_changers()
{
    $background_color = _go('bg_color');
    $background_image = _go('bg_image');
    if ($background_image || $background_color) {
Ejemplo n.º 3
0
<?php

/*============================== TESLA FRAMEWORK ======================================================================================================================*/
require_once locate_template('tesla_framework/tesla.php');
TT_ENQUEUE::$enabled = FALSE;
/*============================== THEME FEATURES ======================================================================================================================*/
function biznex_theme_features()
{
    register_nav_menus(array('biznex_menu' => 'Header Menu'));
    if (!isset($content_width)) {
        $content_width = 1170;
    }
    add_theme_support('post-thumbnails');
    add_theme_support('automatic-feed-links');
}
add_action('after_setup_theme', 'biznex_theme_features');
/*============================== SIDEBARS ======================================================================================================================*/
function biznex_sidebars()
{
    register_sidebar(array('name' => 'Blog Sidebar', 'id' => 'blog-sidebar', 'description' => 'This sidebar is located on the right side of the content on the blog page.', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>'));
}
add_action('widgets_init', 'biznex_sidebars');
/*============================== LANGUAGE SETUP ======================================================================================================================*/
function biznex_language_setup()
{
    load_theme_textdomain('biznex', locate_template('languages'));
}
add_action('after_setup_theme', 'biznex_language_setup');
/*============================== SCRIPTS & STYLES ======================================================================================================================*/
function biznex_scripts_and_styles()
{
Ejemplo n.º 4
0
<?php

/*============================== TESLA FRAMEWORK ======================================================================================================================*/
require_once get_template_directory() . '/tesla_framework/tesla.php';
TT_ENQUEUE::$enabled = false;
/*============================== THEME FEATURES ======================================================================================================================*/
function revoke_theme_features()
{
    register_nav_menus(array('revoke_menu' => 'Revoke Header Menu'));
    if (!isset($content_width)) {
        $content_width = 960;
    }
    if (function_exists('register_sidebar')) {
        register_sidebar(array('name' => 'Blog Sidebar', 'id' => 'blog-sidebar', 'description' => 'This sidebar is located on the left side of the content on the blog page.', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s font2">', 'after_widget' => '</div>', 'before_title' => '<div class="widgetTitle font1 widgettitle">', 'after_title' => '</div>'));
        register_sidebar(array('name' => 'Footer Sidebar', 'id' => 'footer-sidebar', 'description' => 'This sidebar is located in the footer area of the blog page.', 'class' => '', 'before_widget' => '<div class="footerColumn"><div id="%1$s" class="widget %2$s">', 'after_widget' => '</div></div>', 'before_title' => '<div class="titleContainer titleFooter font1 widgettitle"><div class="title">', 'after_title' => '</div></div>'));
        register_sidebar(array('name' => 'Page Sidebar', 'id' => 'page-sidebar', 'description' => 'This sidebar is located on the left side of the content on user created pages. This is the default sidebar for pages.', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s font2">', 'after_widget' => '</div>', 'before_title' => '<div class="widgetTitle font1 widgettitle">', 'after_title' => '</div>'));
        for ($i = 1; $i <= 10; $i++) {
            register_sidebar(array('name' => 'Alternative Sidebar #' . $i, 'id' => 'alt-sidebar-' . $i, 'description' => 'This sidebar is can be chosen as an alternative for Page Sidebar.', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s font2">', 'after_widget' => '</div>', 'before_title' => '<div class="widgetTitle font1 widgettitle">', 'after_title' => '</div>'));
        }
    }
    add_theme_support('post-thumbnails');
    add_theme_support('automatic-feed-links');
}
revoke_theme_features();
/*============================== LANGUAGE SETUP ======================================================================================================================*/
function my_theme_setup()
{
    load_theme_textdomain('revoke', get_template_directory() . '/language');
}
add_action('after_setup_theme', 'my_theme_setup');
/*============================== SCRIPTS & STYLES ======================================================================================================================*/
Ejemplo n.º 5
0
//Load theme details
require_once TT_THEME_DIR . '/theme_config/theme-details.php';
define('THEME_OPTIONS', THEME_NAME . '_options');
//Load main framework classes
require_once TTF . '/extensions/twitteroauth/twitteroauth.php';
require_once TTF . '/core/teslaframework.php';
require_once TTF . '/core/tesla_admin.php';
require_once TTF . '/core/tt_load.php';
if (file_exists(TTF . '/core/tt_security.php')) {
    require_once TTF . '/core/tt_security.php';
} else {
    exit;
}
//TT ENQUEUE
require_once TTF . '/core/tt_enqueue.php';
TT_ENQUEUE::init_enqueue();
//Contact Form Builder
if (file_exists(TT_THEME_DIR . '/theme_config/contact-form-config.php')) {
    require_once TTF . '/core/tt_contact_form.php';
    TT_Contact_Form_Builder::init_builder();
}
//Admin load
$TTA = new Tesla_admin();
//Slider - do not load if plugin TFW detected
if ((!defined('TT_USES_PLUGIN') || defined('TT_USES_PLUGIN') && !TT_USES_PLUGIN) && !class_exists('Tesla_slider')) {
    require_once TTF . '/core/tesla_slider.php';
    Tesla_slider::init();
}
//Subscription
if (file_exists(TT_THEME_DIR . '/theme_config/subscription.php')) {
    require_once TTF . '/core/tt_subscription.php';
Ejemplo n.º 6
0
 /**
  * Empties the temporary files array
  */
 private static function reset_temp()
 {
     self::$files_temp = array();
 }