Ejemplo n.º 1
0
 function __construct()
 {
     Maera_Helper::define('MAERA_VERSION', '1.2');
     Maera_Helper::define('MAERA_ASSETS_URL', get_stylesheet_directory_uri() . '/assets');
     add_filter('kirki/config', array($this, 'customizer_config'));
     $maera_init = new Maera_Init();
     $this->shell = new Maera_Shell();
     $this->timber = new Maera_Timber();
     $this->styles = new Maera_Styles();
     $this->dev = new Maera_Development();
     $this->cache = new Maera_Caching();
     $this->cc = new Maera_Core_Customizer();
     $this->views = new Maera_Template();
     $this->template = $this->views;
     $this->plugins = new Maera_Required_Plugins($this->required_plugins());
     $this->admin = new Maera_Admin();
     // This is not ready yet so hide it.
     // For dev you can add this line to your wp-config.php file:
     // define( 'MAERA_HIDE_CORE_CUSTOMIZER', false );
     if (!defined('MAERA_HIDE_CORE_CUSTOMIZER')) {
         define('MAERA_HIDE_CORE_CUSTOMIZER', true);
     }
     add_action('init', array($this, 'licensing'));
     add_action('wp', array($this, 'updates'));
 }
Ejemplo n.º 2
0
 /**
  * Apply global Timber customizations
  */
 function timber_customizations()
 {
     // Early exit if Timber is not installed
     if (!class_exists('Timber')) {
         return;
     }
     global $wp_customize;
     if (!Maera()->dev->dev_mode()) {
         // Turn on Timber caching.
         // See https://github.com/jarednova/timber/wiki/Performance#cache-the-twig-file-but-not-the-data
         // This is a bit buggy right now on some hosts so we're disabling it.
         // Timber::$cache = true;
         $this->cache_mode();
     } else {
         TimberLoader::CACHE_NONE;
         Timber::$cache = false;
         $_SERVER['QUICK_CACHE_ALLOWED'] = FALSE;
         Maera_Helper::define('DONOTCACHEPAGE', TRUE);
     }
 }
Ejemplo n.º 3
0
 private function __construct()
 {
     do_action('maera/shell/include_modules');
     Maera_Helper::define('MAERA_SHELL_PATH', dirname(__FILE__));
     // Enqueue the scripts
     add_action('wp_enqueue_scripts', array($this, 'scripts'), 110);
     // Add the shell Timber modifications
     add_filter('timber_context', array($this, 'timber_extras'));
     $header_args = array('default-image' => get_template_directory_uri() . '/core-shell/assets/images/grid-back.png');
     add_theme_support('custom-header', $header_args);
     add_theme_support('tonesque');
     add_theme_support('site-logo');
     add_theme_support('infinite-scroll', array('type' => 'click', 'container' => 'content', 'footer' => false));
     add_filter('maera/styles', array($this, 'custom_header'));
     add_filter('maera/styles', array($this, 'colorposts_build_css'));
     add_filter('maera/image/display', '__return_true');
     add_filter('maera/image/width', array($this, 'image_width'));
     add_filter('maera/image/height', array($this, 'image_height'));
     global $content_width;
     $content_width = 774;
 }
Ejemplo n.º 4
0
Archivo: logo.php Proyecto: wpmu/maera
<?php

/**
 * @package     Logo Widget
 * @version     1.0.0
 * @author      Aristeides Stathopoulos, Brian Welch
 * @copyright   2014
 * @link        https://press.codes
 * @license     http://opensource.org/licenses/MIT
 * @uses        Adds a logo widget to Maera.
 *
 */
// Widget folder url
Maera_Helper::define('MAERA_LOGO_WIDGET_URL', get_template_directory_uri() . '/lib/widgets/logo/');
// Widget folder path
Maera_Helper::define('MAERA_LOGO_WIDGET_PATH', dirname(__FILE__));
//Widget root file
Maera_Helper::define('MAERA_LOGO_WIDGET_FILE', __FILE__);
/**
 * Include the logo widget class.
 */
include_once MAERA_LOGO_WIDGET_PATH . '/includes/class-Maera_Logo_Widget.php';
/**
 * Register the widget.
 */
function maera_logo_widget()
{
    register_widget('Maera_Logo_Widget');
}
add_action('widgets_init', 'maera_logo_widget');