Skip to content

Instantly share code, notes, and snippets.

View nickcernis's full-sized avatar

Nick Cernis nickcernis

  • Innsbruck, Austria
  • 03:21 (UTC +02:00)
View GitHub Profile
@nickcernis
nickcernis / functions.php
Last active August 29, 2015 14:07
Ask IE not to use compatibility view (Note: may not work with caching plugins; use Apache/nginx to send headers instead)
<?php
// Don't copy the opening <?php tag above!
// Send headers to ask IE NOT to use compatibility mode
add_filter( 'wp_headers', 'genesis_keep_ie_modern' );
function genesis_keep_ie_modern( $headers ) {
if ( isset($_SERVER['HTTP_USER_AGENT']) && (strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false) ) {
$headers['X-UA-Compatible'] = 'IE=edge';
}
return $headers;
@nickcernis
nickcernis / page_blog.php
Created October 14, 2014 12:10
Change titles from h2 to h1 tags for the blog index in Genesis themes.
<?php
//* Template Name: Blog
if ( genesis_html5() ) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_entry_header', 'my_h1_blog_title' );
} else {
remove_action( 'genesis_post_title', 'genesis_do_post_title' );
@nickcernis
nickcernis / page_blog.php
Created October 14, 2014 11:54
Change titles from h2 to h1 tags for the blog index in XHTML Genesis themes.
<?php
//* Template Name: Blog
remove_action( 'genesis_post_title', 'genesis_do_post_title' );
add_action('genesis_post_title', 'my_h1_blog_title');
function my_h1_blog_title () {
$title = apply_filters( 'genesis_post_title_text', get_the_title() );
@nickcernis
nickcernis / page_blog.php
Created October 14, 2014 11:46
Swap title tags from h2 to h1 on the blog index page in Genesis HTML5 themes.
<?php
//* Template Name: Blog
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action('genesis_entry_header', 'my_h1_blog_title');
function my_h1_blog_title () {
$title = apply_filters( 'genesis_post_title_text', get_the_title() );
/* Author Box
------------------------------------------------------------ */
.author-box {
background-color: #f5f5f5;
border: 1px solid #ddd;
margin: 0 0 40px;
overflow: hidden;
padding: 10px;
}
@nickcernis
nickcernis / init.sls
Created July 30, 2013 14:03
PHP 5.2.17 stack
# /srv/salt/php/init.sls
php:
pkgrepo.managed:
- ppa: skettler/php # https://launchpad.net/~skettler/+archive/php/+packages
- require_in:
- pkg: php
pkg.installed:
- name: php52
- version: 5.2.17~precise~ppa19