Setting up VVV for WordPress Development

This walkthrough video shows how to setup Varying Vagrant Vagrants for WordPress development on a Mac. Also covered is installation of Varying VVV site creation wizard & VVV Provision flipper, both by Brad Parbs, and how to install topdown VVV Dashboard by Jeff Behnke. It’s all pretty straight forward and, in my experience, working with…

Read Post

Function for Post Format Icons

 * Output Post Format icons
 * Outputs an icon for each post format. Set up to use Fontawesome,
 * but can be used with anything, or you can just use CSS.
 * @return string
function post_format_icon() {
  global $post;
  // get current post ID
  $id     = $post->ID;
  // get post format
  $format = get_post_format( $id );
  // array of icons as $format => $icon key/value pairs
  $icons = [
    'standard' => 'fa-pencil',
    'aside'    => 'fa-sticky-note',
    'chat'     => 'fa-comments',
    'gallery'  => 'fa-picture-o',
    'link'     => 'fa-external-link',
    'image'    => 'fa-camera',
    'quote'    => 'fa-quote-left',
    'status'   => 'fa-commenting',
    'video'    => 'fa-video-camera'
  // format will return false if no format is set. So, evaluate against this..
  // if format = false then $icon = standard, else icon = selected format
  $format == ( false ) ? $icon = $icons['standard'] : $icon = $icons[ $format ];
  // string to be output
  // echo a full line of html or just drop the output in as a class
  $output = $icon;
  // return the output
  return $output;

Github Gist

Read Post