• Home
  • About Mitch
  • Speaking
  • Articles
  • Contact
  • Home
  • About Mitch
  • Speaking
  • Articles
  • Contact

Digital Strategist

WordPress Developer

Content Creator

Unapologetic Punk

Mitch Canter

  • X
  • Bluesky
  • GitHub
  • Twitch
  • YouTube
  • LinkedIn
WordPress

BlogInfo – One Tag with a Whole Lot of Awesomeness

CMDR Mitchcraft

Reading time: 1 minute

blog[1]One of the most versitile tags in my arsenal that WordPress gives me is a fun little tag called <?php bloginfo(); ?>.  By itself, it’s not much fun, but when you add in a variable, it can tell you anything you need to know about your blog.  Like what, you ask?

  • name
  • description
  • admin_email
  • url
  • wpurl
  • stylesheet_directory
  • stylesheet_url
  • template_directory
  • template_url
  • atom_url
  • rss_url
  • pingback_url
  • rdf_url
  • comments_atom_url
  • comments_rss2_url
  • charset
  • html_type
  • language
  • text_direction
  • version

Look at all of the information packed into one template tag.  So, what are it’s practical uses?

Pull an Image From Your Template Folder

<img src=”<?php bloginfo(‘template_directory’); ?>/images/image.png”>

This lets you add images into your themes, and (no matter what the url is) the image will be pulled from the theme folder directly.  Even works if the user changes the name or folder text.

Add an RSS Feed Subscription Link Anywhere!

<a href=”<?php bloginfo(‘rss_url’); ?>”>subscribe to the feed</a>

Add a Link to the Home Page Anywhere!

<a href=”<?php bloginfo(‘url’); ?>”>Home</a>

These are just a few of the uses I’ve personally used in themes with this tag.  Do you use it for something different?

Bloginfo, rss_url, template_directory, url, WordPress
  • Fighting the WordPress White Screen of Death

    Fighting the WordPress White Screen of Death

    Reading time: 1 minute

    We’ve all been there: We’re editing the WordPress theme file, setting a new function and *BAM*: We view the site and it’s nothing but a sea of white pixels.  There’s no messages, no errors, nothing to indicate what you’ve done wrong.  And it’s frustrating: sure, removing the change would fix the problem, but I (as I’m…

    WordPress
  • Getting into Gutenberg, Part 2: A Knee-Jerk REACTion (and an Introduction to Gutenberg Blocks)

    Getting into Gutenberg, Part 2: A Knee-Jerk REACTion (and an Introduction to Gutenberg Blocks)

    Reading time: 4 minutes

    I wrote yesterday on Gutenberg, WordPress' soon-to-be editing experience, as it was highly mentioned at WordCampUS here in Nashville over the weekend. Yesterday, I focused specifically on the outer facade of Gutenberg – movable blocks, layouts, and modular approaches to content. Today, we're going to look at the back-end. For a WordPress developer, this is…

    WordPress