Skip to content

Instantly share code, notes, and snippets.

View rfmeier's full-sized avatar
💭
Nada.

Ryan Meier rfmeier

💭
Nada.
View GitHub Profile
@rfmeier
rfmeier / sample.php
Created January 8, 2016 21:48
Register custom meta boxes for the 'testimony' archive settings
<?php
/**
* Register custom meta boxes for the 'testimony' archive settings.
*/
add_action( 'genesis_cpt_archives_settings_metaboxes' , 'cpt_as_testimony_archive_metaboxes' );
/**
* Callback for Genesis 'genesis_cpt_archives_settings_metaboxes' action.
*
* Register custom meta boxes for the 'testimony' archive settings.
@rfmeier
rfmeier / sample.php
Created January 8, 2016 21:47
Register a sanitization callback for the custom setting
<?php
/**
* Register a sanitization callback for the custom setting.
*/
add_action( 'genesis_settings_sanitizer_init', 'cpt_as_genesis_sanitize_settings' );
/**
* Callback for Genesis 'genesis_settings_sanitizer_init' action.
*
* Add the settings to the filter.
@rfmeier
rfmeier / sample.php
Created January 8, 2016 21:45
Add archive settings default for a custom post type
<?php
/**
* Add archive settings default for a custom post type
*/
add_filter( 'genesis_cpt_archive_settings_defaults', 'cpt_as_testimony_archive_settings_defaults', 10, 2 );
/**
* Callback for Genesis 'genesis_cpt_archive_settings_defaults' filter.
*
* Add the custom settings default value for the post type 'testimony'.
@rfmeier
rfmeier / count.sh
Created December 16, 2015 23:07
Get number of php files in a directory
#!/bin/bash
find ./ -type f -print | grep php | wc -l
@rfmeier
rfmeier / style.css
Last active November 20, 2015 22:03
Metro Theme Display Description text
.site-title {
margin: 0;
}
.site-description,
.header-image .site-description {
text-indent: 0;
font-style: italic;
color: #201496;
}
@rfmeier
rfmeier / phprc
Last active March 12, 2019 02:50
Enable opcache on DreamHost for php 5.5 and greater
[opcache]
; the path to the .so file
zend_extension=opcache.so
; Enabled. Set to 0 to disable
opcache.enable=1
; Max memory consumption. Default 32 megs
opcache.memory_consumption=32
@rfmeier
rfmeier / style.css
Last active August 29, 2015 14:12
Fixing Broke Parallax Pro Menu on iPad
/**
* Genesis Parallax Pro theme style.css file
*
* Note: This is from the original Parallax Pro theme. If you
* have changed the theme to you liking, you may need to adjust
* a different spot in the code.
*/
/* around line ~1813 */
@media only screen and (max-width: 1140px) {
@rfmeier
rfmeier / example.html
Created October 14, 2014 15:08
html5 microdata GeoCoordinates markup
<!-- The parent 'SportsActivityLocation' element, however you may structure it -->
<div itemscope itemtype="http://schema.org/SportsActivityLocation">
<!--
Some other possible elements.
-->
<span itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
<!-- Display coordinate data if you wish... -->
<meta itemprop="latitude" content="-33.0000" />
<meta itemprop="longitude" content="18.0000" />
</span>
@rfmeier
rfmeier / functions.php
Last active August 29, 2015 14:02
Set the WordPress home to use the archive template.
<?php
/**
* Do not include the <?php tag... your functions.php should already have one.
*
* In response to Genesis support forums.
* http://www.studiopress.com/forums/topic/minimum-pro-archive-portfolio-for-catgeory-archive-pages-and-home-page/
*/
add_action( 'pre_get_posts', 'custom_pre_get_posts' );
/**
@rfmeier
rfmeier / functions.php
Last active August 29, 2015 14:02
Alter Genesis based on the current post type.
<?php
/**
* Do not include the <?php tag if your functions.php file already has one.
* In response to Genesis support forums thread;
* http://www.studiopress.com/forums/topic/shortcode-with-custom-loop-in-page-affecting-search-results/
*/
add_action( 'genesis_setup', 'jspt_genesis_setup' );
/**
* Callback for Genesis 'genesis_setup' action.