Skip to content

Instantly share code, notes, and snippets.

@nhatdong
nhatdong / javascript-masonry.php
Created November 26, 2015 15:55 — forked from neilgee/javascript-masonry.php
Masonry in WordPress
<?php
//Masonry load scripts
function wpb_masonry_scripts_styles_alt() {
wp_enqueue_script ( 'masonry'); //jqueryless
}
add_action( 'wp_enqueue_scripts', 'wpb_masonry_scripts_styles_alt' );
//Masonry Style javascript
function wpb_js_masonry() { ?>
@nhatdong
nhatdong / functions.php
Created November 26, 2015 15:52 — forked from neilgee/functions.php
WooCommerce Genesis Connect + WooCommerce Sidebar
<?php //<~ don't add in
// Declare WooCommerce support for your theme
add_theme_support( 'woocommerce' );
// Register 'videos' Post Type
if ( ! function_exists('jivedig_videos_post_type') ) {
function jivedig_videos_post_type() {
$labels = array(
'name' => _x( 'Videos', 'themename' ),
'singular_name' => _x( 'Video', 'themename' ),
'menu_name' => __( 'Videos', 'themename' ),
'parent_item_colon' => __( 'Parent Video:', 'themename' ),
'all_items' => __( 'All Videos', 'themename' ),
'view_item' => __( 'View Video', 'themename' ),
// ------------------------------ Video Categories
if ( ! function_exists('jivedig_video_category_taxonomy') ) {
// Register Custom Taxonomy
function jivedig_video_category_taxonomy() {
$labels = array(
'name' => 'Video Categories',
'singular_name' => 'Video Category',
'menu_name' => 'Video Categories',
'all_items' => 'All Video Categories',
<?php
add_action('genesis_before_post_title', 'sfws_homepage_teaser_image');
/**
* Adds Images to Posts in Grid
*
* Takes the amount of posts and applies the right size image, whether it's a featured post or a grid block post.
*
* @category Grid Loop
* @author Jonathan Perez, SureFireWebServices <jperez@surefirewebservices.com>
<?php
/**
* Define color choices for a Genesis Child Theme
* and then set up a way for them to be changed from the
* front end in a theme demo.
*
* @author FAT Media <http://youneedfat.com>
* @copyright Copyright (c) 2013, FAT Media, LLC
* @license GPL-2.0+
*/
@nhatdong
nhatdong / Genesis Portfolio Custom Post Tpe With Archive Settings.php
Created January 5, 2014 11:06
Genesis Portfolio Custom Post Tpe With Archive Settings
/** Create portfolio custom post type */
add_action( 'init', 'second_portfolio_post_type' );
function second_portfolio_post_type() {
register_post_type( 'portfolio',
array(
'labels' => array(
'name' => __( 'Second Portfolio', 'minimum' ),
'singular_name' => __( 'Second Portfolio', 'minimum' ),
),
'exclude_from_search' => true,
@nhatdong
nhatdong / Redirect Your RSS Feed to FeedBurner 1
Created January 5, 2014 11:03
Redirect Your RSS Feed to FeedBurner
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} !^(FeedBurner|FeedValidator) [NC]
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/Bit51 [R=301,NC,L]
@nhatdong
nhatdong / Add Jetpack share buttons above post
Created January 5, 2014 09:47
Add Jetpack share buttons above post
//* Add Jetpack share buttons above post
remove_filter( 'the_content', 'sharing_display', 19 );
remove_filter( 'the_excerpt', 'sharing_display', 19 );
add_filter( 'the_content', 'share_buttons_above_post', 19 );
add_filter( 'the_excerpt', 'share_buttons_above_post', 19 );
function share_buttons_above_post( $content = '' ) {
if ( function_exists( 'sharing_display' ) ) {
return sharing_display() . $content;
@nhatdong
nhatdong / Add post navigation to Genesis
Created January 5, 2014 09:45
Add post navigation to Genesis
//* Add post navigation (requires HTML5 theme support)
add_action( 'genesis_entry_footer', 'genesis_prev_next_post_nav', 15 );