Skip to content

Instantly share code, notes, and snippets.

vagrant reload --provision --debug
INFO global: Vagrant version: 1.8.5
INFO global: Ruby version: 2.2.3
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_OLD_ENV_ITERM_PROFILE="Default"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_OLD_ENV_TERM_SESSION_ID="w0t0p0:54CE2353-690B-4AE4-8A63-E08C741B79AC"
INFO global: VAGRANT_OLD_ENV_SSH_AUTH_SOCK="/private/tmp/com.apple.launchd.4z9A7HEhPx/Listeners"
INFO global: VAGRANT_OLD_ENV_COLORFGBG="12;8"
INFO global: VAGRANT_OLD_ENV_LANG="en_US.UTF-8"
vagrant up
__ ___ ___ __ ____
\ \ / \ \ / \ \ / / |___ \
\ \ / / \ \ / / \ \ / / __) |
\ V / \ V / \ V / / __/
\_/ \_/ \_/ |_____|
Varying Vagrant Vagrants v2.1.0-master
Docs: https://varyingvagrantvagrants.org/
Contribute: https://github.com/varying-vagrant-vagrants/vvv
@ericdebelak
ericdebelak / iframe.php
Created September 14, 2016 21:25
Allow iframe and other tags in WordPress excerpt or content limit
<?php
// Don't Strip HTML from Excerpts or Content Limit
add_filter('get_the_content_limit_allowedtags', 'childtheme_custom_allowedtags');
function childtheme_custom_allowedtags() {
return '<script>,<style>,<strong>,<b>,<br>,<em>,<iframe>'; //add whatever tags you want to this string
}
?>
@ericdebelak
ericdebelak / add-parent-page-title.php
Created August 29, 2016 23:48
Add a parent page title before a page title in Genesis
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action('genesis_entry_header', 'add_parent_page_title');
function add_parent_page_title() {
global $post;
$postID = get_the_ID();
if ( is_page() && $post->post_parent) {
// get the parent page
$parentPage = wp_get_post_parent_id( $postID );
// echo out the new title with the parent page in it
echo '<h1 class="entry-title">' . get_the_title($parentPage) . ' - ' . get_the_title( $postID ) . '</h1>';
@ericdebelak
ericdebelak / order-posts.php
Created August 29, 2016 23:40
Order posts alphabetically in genesis
//* order posts alphabetically
add_action('genesis_before_loop', 'eleven_online_before_loop');
function eleven_online_before_loop () {
global $query_string;
query_posts($query_string . "&order=ASC&orderby=title");
}
@ericdebelak
ericdebelak / page_blog.php
Created August 29, 2016 23:31
Use blog page content above blog posts in genesis with a container around the posts
<?php
//* Template Name: Blog
//* Show page content above posts
add_action( 'genesis_loop', 'genesis_standard_loop', 5 );
//* Add our blog container
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'genesis_do_loop_with_container' );
function genesis_do_loop_with_container() {
echo '<div id="blog-container">';
@ericdebelak
ericdebelak / add-secondary-page-header.php
Created August 29, 2016 23:26
Add a banner to secondary pages in Genesis from Featured Image
//* Add secondary page header
add_action('genesis_after_header', 'add_secondary_page_header');
function add_secondary_page_header() {
if(!is_home()) {
if(has_post_thumbnail()) {
echo "<div class='page-header' style='background: url(" . get_the_post_thumbnail_url() . ")'></div>";
} else {
echo "<div class='page-header'></div>";
}
}