Skip to content

Instantly share code, notes, and snippets.

View davidperezgar's full-sized avatar

David Perez davidperezgar

View GitHub Profile
<?php
/**
* Archive Post Class
* @since 1.0.0
*
* Breaks the posts into three columns
* @link http://www.billerickson.net/code/grid-loop-using-post-class
*
* @param array $classes
<?php
add_filter( 'pre_get_posts', 'be_archive_query' );
/**
* Archive Query
*
* Sets all archives to 27 per page
* @since 1.0.0
* @link http://www.billerickson.net/customize-the-wordpress-query/
*
@davidperezgar
davidperezgar / functions.php
Created September 6, 2016 21:47
Remove a layout with the Genesis Framework.
<?php
//* Do NOT include the opening php tag
//* Remove content/sidebar layout
genesis_unregister_layout( 'content-sidebar' );
//* Remove sidebar/content layout
genesis_unregister_layout( 'sidebar-content' );
//* Remove content/sidebar/sidebar layout
@davidperezgar
davidperezgar / .gitignore
Last active September 8, 2016 11:06 — forked from octocat/.gitignore
Gitignore for Wordpress Pages
#Wordpress
htaccess.txt
index.php
licencia.txt
license.txt
readme.html
robots.txt
wp-activate.php
wp-admin/
wp-blog-header.php
@davidperezgar
davidperezgar / functions.php
Created September 18, 2016 21:22
Remove the edit link on your site using the Genesis Framework.
<?php
//* Do NOT include the opening php tag
//* Remove the edit link
add_filter ( 'genesis_edit_post_link' , '__return_false' );
@davidperezgar
davidperezgar / custom-favicon.php
Last active September 26, 2016 11:22 — forked from studiopress/custom-favicon.php
Genesis images.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Display a custom favicon
add_filter( 'genesis_pre_load_favicon', 'cmk_favicon_filter' );
function cmk_favicon_filter( $favicon_url ) {
return get_stylesheet_directory_uri().'/images/favicon.png';
}
//* Register widget areas
genesis_register_sidebar( array(
'id' => 'pre-footer',
'name' => __( 'Before Footer Widgets', 'theme' ),
'description' => __( 'This is a Pre-Footer Widget area.', 'theme' ),
) );
add_action('genesis_before_footer', 'pre_footer_widget', 2 );
function pre_footer_widget() {
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add post navigation (requires HTML5 theme support)
add_action( 'genesis_entry_footer', 'genesis_prev_next_post_nav' );
@davidperezgar
davidperezgar / functions.php
Created October 18, 2016 06:45
Force a layout with the Genesis Framework.
<?php
//* Do NOT include the opening php tag
//* Force content-sidebar layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
//* Force sidebar-content layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_content' );
//* Force content-sidebar-sidebar layout
@davidperezgar
davidperezgar / functions.php
Created October 18, 2016 06:49
Set a default layout with the Genesis Framework.
<?php
//* Do NOT include the opening php tag
//* Set content/sidebar as the default layout
genesis_set_default_layout( 'content-sidebar' );
//* Set sidebar/content as the default layout
genesis_set_default_layout( 'sidebar-content' );
//* Set content/sidebar/sidebar as the default layout