Add Bootstrap Classes to the Next and Previous Image Buttons

When viewing media (usually the image.php template) within WordPress – there are buttons to browse the next and previous buttons that you might want to customize if you are creating a Bootstrap WordPress them. If this is the case – styling the buttons with Bootstrap is easy. You can simply add the following to your theme’s functions.php file.

/**
 * Add CSS class to image navigation links.
 *
 * @wp-hook previous_image_link
 * @wp-hook next_image_link
 * @param   string $link Complete markup
 * @return  string
 */
add_filter( 'previous_image_link', 'lucidity_img_link_class' );
add_filter( 'next_image_link', 'lucidity_img_link_class' );

function lucidity_img_link_class( $link ) {
    $class = 'next_image_link' === current_filter() ? 'next' : 'prev';
    return str_replace( '<a ', "<a class='btn btn-default $class'", $link );
}

Note – you can change the btn-default class to btn-primary or whatever you need.

Be Kind…

I cannot stress this enough to my kids…(and myself)

“Be kind, for everyone you meet is fighting a battle you know nothing about.”

― Wendy Mass, The Candymakers

My Christmas List This Year

With only a week left before the big day – here are some of things that top my list this year:

Zelazny Money Clip

IMG_3050.JPG

I grew up in a house where we used vice grips for just about everything. This is my latest use of my favorite tool.