Upload
temian-vlad
View
82
Download
0
Tags:
Embed Size (px)
Citation preview
codereview
push on feature branch
deploy after a master commit
github.com
vagrantgazeta.info.ro
plugins and themes changes
<?php// load theme styles from parent and from childadd_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style') );}
// load languages from child themeload_theme_textdomain( 'hueman', get_stylesheet_directory() . '/languages' );
// load javascript dependencieswp_enqueue_script('twitter', get_stylesheet_directory_uri() . '/js/twitter.js');wp_enqueue_script('facebook', get_stylesheet_directory_uri() . '/js/facebook.js');
// fix auto quotingremove_filter( 'the_title', 'wptexturize' );remove_filter( 'the_content', 'wptexturize' );remove_filter( 'the_excerpt', 'wptexturize' );remove_filter( 'comment_text', 'wptexturize' );?>
<?php
namespace Blogwerk\Theme;
use Blogwerk\Theme\AbstractTheme;
class TwigExample extends AbstractTwigTheme{ const SLUG_SIDEBAR = 'sidebar'; const SLUG_MENU = 'menu'; public function setup() { // specifiy the twig views folder in the current theme $this->services['view_path'] = function($c){ return $c['map_folder']('views/twig'); }; $this->registerViews(array( // main entry points 'index' => 'main.html.twig', 'home' => 'main.html.twig', 'frontpage' => 'main.html.twig', // layout 'header' => 'layout/header.html.twig', 'footer' => 'layout/footer.html.twig', 'sidebar' => 'layout/sidebar.html.twig', ));
// register sidebar register_sidebar(array( 'name' => 'Sidebar', 'description' => __('Sidebar', $this->getTextDomain()), 'id' => static::SLUG_SIDEBAR, 'before_widget' => '<section class="widget %2$s clearfix">',
'after_widget' => '</section>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>', )); // register menu register_nav_menus(array( static::SLUG_MENU => 'Main Menu', )); } public function setupComponents() { $this->registerComponents(array( // Menu Component '\\Blogwerk\\Theme\\Component\\Menu', )); } /** * register widgets at widgets_init(10) */ public function widgets() { register_widget('\\Blogwerk\\Widget\\Image'); } /** * Registers assets */ public function assets() { wp_enqueue_style('blogwerk-theme-css', $this->resolveUri('resources/styles/styles.css'), array(), $this->getVersion()); }}