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();
 }
Ejemplo n.º 2
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.º 3
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 ======================================================================================================================*/