Show / hide the WordPress Admin toolbar

Posted on

During WordPress theme development, you might sometimes find the WordPress admin toolbar to be quite distracting. It’s in a fixed position at the top of the window and depending on your layout can cover some elements of the header. The bar adds space (margin) at the top of the page that might hide some of […]

Rev Slider using Neilo Feature Image

Posted on

So here was our full filter function previously that is for Rev Slider to pull the Nelio Feature image if the post doesn’t have a feature image already set. My client almost never sets a feature image and this snippet had been working for us until version 2.0. In Rev Slider we have the background […]

How to Modify Featured Images in WordPress

Posted on

1. Automatically set featured image in WordPress Using featured images in WordPress is easy and relatively simple to set up even if your theme doesn’t support the feature from scratch. We have already shown you how to set and display the basic featured image, and you will learn how to check if there is a featured […]

Display Post Thumbnail Without Being Featured Image

Posted on

Just check for the thumbnail, and if it’s not set, use the first image from the gallery instead. Something like this: $size = ‘thumbnail’; // whatever size you want if ( has_post_thumbnail() ) { the_post_thumbnail( $size ); } else { $attachments = get_children( array( ‘post_parent’ => get_the_ID(), ‘post_status’ => ‘inherit’, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => […]