Skip to content

Instantly share code, notes, and snippets.

html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
@thebeckyhamm
thebeckyhamm / author-permalinks.php
Created May 4, 2015 18:54
Change author permalinks
@thebeckyhamm
thebeckyhamm / modify-user-columns.php
Last active September 26, 2015 12:18
add a column to the user page and adds the data to the column
function ms_modify_user_columns($column_headers) {
$column_headers['membership'] = 'Membership';
return $column_headers;
}
add_action('manage_users_columns','ms_modify_user_columns');
function ms_get_user_membership($empty = '', $column_name, $id) {
if( $column_name == 'membership' ) {
@thebeckyhamm
thebeckyhamm / remove-user-profile-fields.php
Created May 4, 2015 18:51
removes / modifies user profile fields
function modify_contact_methods($profile_fields) {
// Remove old fields
unset($profile_fields['twitter']);
unset($profile_fields['googleplus']);
unset($profile_fields['facebook']);
return $profile_fields;
}
add_filter('user_contactmethods', 'modify_contact_methods');
@thebeckyhamm
thebeckyhamm / author-sorting.php
Created May 4, 2015 18:48
Return authors who match a particular custom meta field, then sort them with the cmp function
$blogusers = get_users(
array( "fields" => "all_with_meta" ,
"meta_query" => array(
array(
'key' => '_cmb_on_lt',
'value' => 'no',
'compare' => '!='
),
)
)
@thebeckyhamm
thebeckyhamm / Yoast SEO.php
Created April 23, 2015 15:16
Move Yoast SEO to bottom
// Move Yoast to bottom
function yoasttobottom() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'yoasttobottom');
@thebeckyhamm
thebeckyhamm / SVG Fallback
Last active January 1, 2017 19:40
svg with fallback using picture element. Don't use until better supported/or use picturefill
<picture>
<source type="image/svg+xml" srcset="path/to/image.svg">
<img src="path/to/fallback.png" alt="Image description">
</picture>
@thebeckyhamm
thebeckyhamm / shortcode-meta-box.php
Created November 12, 2014 01:55
Use shortcodes in custom meta boxes
<?php echo apply_filters('the_content', get_post_meta($post->ID, 'meta_box_name', true)); ?>
@thebeckyhamm
thebeckyhamm / minimum-p.css
Created November 3, 2014 01:34
Minimum paragraph width - pushes down paragraph next to floating images
p:before {
content: "";
width: 6em;
display: block;
overflow: hidden;
}
@thebeckyhamm
thebeckyhamm / wordpress-plugins.txt
Last active August 29, 2015 14:08
WordPress Plugins I Like
Imsanity https://wordpress.org/plugins/imsanity/
Custom Sidebars https://wordpress.org/plugins/custom-sidebars/
Black Studio TinyMCE Widget https://wordpress.org/plugins/black-studio-tinymce-widget/
WordPress Post Type Archive Links https://wordpress.org/plugins/post-type-archive-links/
Eww Image Optimizer https://wordpress.org/plugins/ewww-image-optimizer/ (disallowed by wp-engine)
Autoptimize https://wordpress.org/support/view/plugin-reviews/autoptimize
PageSpeed Insights https://wordpress.org/plugins/google-pagespeed-insights/screenshots/