Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Cernis nickcernis

  • Innsbruck, Austria
View GitHub Profile
@nickcernis
nickcernis / page_blog.php
Created Oct 14, 2014
Change titles from h2 to h1 tags for the blog index in XHTML Genesis themes.
View page_blog.php
<?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 Oct 14, 2014
Change titles from h2 to h1 tags for the blog index in Genesis themes.
View page_blog.php
<?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 Oct 14, 2014
Swap title tags from h2 to h1 on the blog index page in Genesis HTML5 themes.
View page_blog.php
<?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() );
@nickcernis
nickcernis / functions.php
Last active Aug 29, 2015
Ask IE not to use compatibility view (Note: may not work with caching plugins; use Apache/nginx to send headers instead)
View functions.php
<?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 / Home Section 1 widget
Created Oct 16, 2014
How to modify the Parallax theme to add arrows on the homepage that autoscroll between sections
View Home Section 1 widget
<!-- Add this to the bottom of your home section 1 widget in WordPress's Appearance > Widgets area-->
<a class="next-pane" data-goto=".home-section-2">&darr;</a>
@nickcernis
nickcernis / page_blog.php
Created Oct 17, 2014
A custom loop that displays one post on the Genesis Blog template
View page_blog.php
<?php
// Template Name: Blog
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'newspro_do_custom_loop' );
function newspro_do_custom_loop() {
global $paged;
@nickcernis
nickcernis / functions.php
Created Nov 26, 2014
Add galleries to homepage posts in Mindstream
View functions.php
// Add galleries to posts on the homepage if they have them
add_action( 'genesis_post_content', 'sp_gallery_in_excerpt', 1 );
function sp_gallery_in_excerpt() {
if ( !is_home() && !is_front_page() )
return;
if ( get_post_gallery() )
echo get_post_gallery();
}
View gist:81b4dac8fcc59525a307
add_action('genesis_after_header', 'wpsites_two_column_widgets');
/*** @author Brad Dalton* @example http://wpsites.net/* @copyright 2014 WP Sites */
function wpsites_two_column_widgets()
{
if (is_front_page() && is_active_sidebar('left-column') || is_active_sidebar('right-column')) {
echo '<div class="two-column-widgets">';
echo '<div class="wrap">';
genesis_widget_area('left-column',
array(
View template_fwcblgpost.php
<?php
/**
* Template Name: Full Width Content with Blog Posts
*
* @author Genesis Developer
* @link http://genesisdeveloper.me/full-width-page-content-with-blog-posts
* @license GPL-2.0+
* @since: 0.1
*/
@nickcernis
nickcernis / style.css
Created Dec 7, 2014
AgentPress Pro Home Bottom featured posts instead of pages
View style.css
.home-bottom .featuredpost .entry {
width: 23.875%;
}
.home-bottom.full-width .featuredpost .entry:nth-of-type(3n+1) {
clear: none;
margin-left: 1.5%;
}
.home-bottom.full-width .featuredpost .entry:nth-of-type(4n+1) {
You can’t perform that action at this time.