Skip to content

Instantly share code, notes, and snippets.

@CoachBirgit
CoachBirgit / sample.html
Created January 13, 2016 16:00
Sample HTML used for social media links using Ionicons with the Genesis Framework.
<p class="social">
<a href="http://twitter.com/bgardner"><i class="icon ion-social-twitter"></i></a>
<a href="http://www.facebook.com/bgardner"><i class="icon ion-social-facebook"></i></a>
<a href="http://instagram.com/bgardner"><i class="icon ion-social-instagram-outline"></i></a>
<a href="http://dribbble.com/bgardner"><i class="icon ion-social-dribbble-outline"></i></a>
</p>
@CoachBirgit
CoachBirgit / sample.css
Created January 13, 2016 16:00
Sample CSS used for social media links using Ionicons with the Genesis Framework.
/* Ionicons
--------------------------------------------- */
.site-footer p.social a {
border: 1px solid #949792;
border-radius: 50%;
color: #949792;
display: inline-block;
height: 42px;
margin-left: 10px;
@CoachBirgit
CoachBirgit / sample.html
Created January 13, 2016 16:00
Sample HTML to add "Made with Love" to your site footer with the Genesis Framework.
<p class="love">Made with <i class="icon ion-heart"></i> by Brian Gardner</p>
@CoachBirgit
CoachBirgit / sample.css
Created January 13, 2016 15:59
Sample CSS to add "Made with Love" to your site footer with the Genesis Framework. Raw
/* Heart Icon
--------------------------------------------- */
.site-footer .icon {
font-size: 20px;
}
.site-footer .love .icon {
font-size: 12px;
margin-left: 2px;
@CoachBirgit
CoachBirgit / functions.php
Created January 13, 2016 15:59
Exclude categories from blog homepage with the Genesis Framework.
<?php
//* Do NOT include the opening php tag
//* Exclude categories from blog homepage
add_action( 'pre_get_posts', 'bg_exclude_categories' );
function bg_exclude_categories( $query ) {
if( $query->is_main_query() && $query->is_home() ) {
$query->set( 'cat', '-5,-7' );
}
@CoachBirgit
CoachBirgit / functions.php
Created January 13, 2016 15:59
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
@CoachBirgit
CoachBirgit / vagrant-cheat-sheet.md
Last active October 28, 2015 10:21 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Common Vagrant Commands

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
  • vagrant status -- outputs status of the vagrant machine
  • vagrant halt -- stops the vagrant machine
  • vagrant reload -- restarts vagrant machine, loads new Vagrantfile configuration
  • vagrant provision -- forces reprovisioning of the vagrant machine
@CoachBirgit
CoachBirgit / wp-api-custom-taxonomies.php
Created October 28, 2015 05:39 — forked from scottopolis/wp-api-custom-taxonomies.php
Add custom taxonomies to the WP-API
<?php
function ms_add_tax_to_api() {
$taxonomies = get_taxonomies( '', 'objects' );
foreach( $taxonomies as $taxonomy ) {
$taxonomy->show_in_rest = true;
}
}
add_action( 'init', 'ms_add_tax_to_api', 30 );
add_action('um_submit_form_errors_hook', 'check_customer_code', 100 );
function check_customer_code( $args ){
if ( isset( $args['customer_code'] ) && $args['customer_code'] != 'ABCDE' )
exit( wp_redirect( add_query_arg('err', 'invalid_customer_code') ) );
}
/* This example syncs both UM / WP role during user approval */
add_action('um_after_user_is_approved', 'sync_um_and_wp_role', 99 );
function sync_um_and_wp_role( $user_id ) {
// Get UM role
$role = get_user_meta( $user_id, 'role', true );
// Set WordPress role for same user
$wp_user_object = new WP_User( $user_id );