Introducing Bedrock, a Minimal Base Theme for WordPress

Since I started building frontend templates and WordPress themes, I’ve been collecting my own bag of tricks and reusable code snippets. Now at long last, I’ve put them together and gotten them up on the web. Introducing Bedrock – a simple base theme for WordPress web development. There’s a few different parts to this:

The Secret to Enqueuing Scripts in the WordPress Footer

WordPress offers the enqueue_scripts feature, which allows theme developers to carefully manage their script dependencies and versions.  Here’s the syntax: First your register your script – <?php wp_register_script( $handle, $src, $deps, $ver, $in_footer ); ?> Then enqueue it, and pass it the handle that you gave it: wp_enqueue_script( $handle ,$src ,$deps ,$ver ,$in_footer );

The Ultimate Guide to WordPress Post Excerpts

Displaying post excerts in WordPress can be surprisingly confusing. Here’s an explanation of the options.   WordPress Default Excerpts A WP post lets you define the main content, and an optional excerpt.  By default, pages do not offer excerpts, but you can change that. 

The Simplest Way to Get Paypal Transaction Data Back to Your PHP Website

Integrating Paypal into a website is kind of a pain. The technology works. And the documentation is out there. But it’s buried within their maze of a website without very much high level explanation. But after some poking around, I found what is basically the simplest way to get Paypal info back to your website, […]

The 5 Most Important WordPress Resources

WordPress is a pretty amazing platform but it can be a little overwhelming at first. The WP Codex has a wealth of information, but it’s not always organized the best (or completely thorough, for that matter).  Here’s a list of my essential WordPress resources, from inside the Codex and out. Hopefully these help guide you […]

How to Query WordPress Posts from Outside of WordPress

It’s surprisingly easy, just 2 lines lets us put on a disguise and start digging into WordPress: define(‘WP_USE_THEMES’, false); require(‘../wp-load.php’); That’s it!  (Replace the path to wp-load with the path to your WordPress root.) After loading these files, you can query WordPress as normal and do whatever you want with all the juicy post data. […]

How to Capture PHP Output into a Variable

Today I had a chance to do “output buffering” with PHP. Output buffering allows us to “capture” the stuff that PHP is sending to the screen, for use later on behind the scenes. Output buffering is one of my favorite things to do with PHP, it’s just weird and cool. Also it’s way easy: <?php ob_start(); ?> […]