Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Donna McMaster donnamcmaster

🏠
Working from home
Block or report user

Report or block donnamcmaster

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@donnamcmaster
donnamcmaster / wp-tag-cloud-smaller-fonts.php
Created Apr 6, 2017
WordPress: reduce the font sizes in the tag cloud
View wp-tag-cloud-smaller-fonts.php
<?php
/**
* Reduce the font sizes in the WordPress tag cloud
*/
add_filter( 'widget_tag_cloud_args', function( $args ) {
$args['smallest'] = 11;
$args['largest'] = 24;
$args['unit'] = 'px';
return $args;
});
@donnamcmaster
donnamcmaster / wp-post-type-slug-body-class.php
Created Apr 6, 2017
WordPress: adds the post type and slug to the <body> class, e.g., "page-about"
View wp-post-type-slug-body-class.php
<?php
/**
* Adds the post type and slug to the <body> class, e.g., "page-about".
*/
add_filter( 'body_class', function( $classes ) {
global $post;
if ( isset( $post ) ) {
$classes[]= "{$post->post_type}-{$post->post_name}";
@donnamcmaster
donnamcmaster / wp-add-gallery-title-field.php
Last active May 19, 2017
WordPress: set a title attribute in gallery output; some plugins will display this as a caption
View wp-add-gallery-title-field.php
@donnamcmaster
donnamcmaster / wp-piklist-metabox-top-pages-only.php
Last active Apr 6, 2017
WordPress: Make Piklist plugin show metabox only for top-level pages (i.e., post_parent = 0)
View wp-piklist-metabox-top-pages-only.php
<?php
/**
* This code went into the file in piklist/parts/metaboxes
*/
/*
Title: Section Name
Post Type: page
Top pages only: true
*/
You can’t perform that action at this time.