Full size thumbnail image w/ alt tag title

Here is a quick example of how to add a large thumbnail image with the title as the Alt Tag attribute Alt Tag attribute <?php the_post_thumbnail( ‘large’, array( ‘title’ => get_the_title() ) ); ?> You can replace ‘large’ with thumbnail, medium, medium_large, & full.

Fixing the blog page title in WP

If your blog page is pulling the title of the last/latest post, here is a quick and dirty fix Add this to your title tags: Examples:

How to add a header image in WP

Here is a quick example of how to add a background image to the header of your WordPress website pulling the Feature Image Featured Image Code: You could also use:

Adding the_excerpt in WP

How to add auto excerpts to a WP Theme: For this example, I’m using the WP Bootstrap Starter theme (remember to create a Child theme, or you will lose any edits after you update). You need to locate content.php file, it should be under the template-parts folder: Find the code: Approx. line 33. Replace with:… Read More

Add a Gravity Forms shortcode in WordPress (PHP)

To add a Gravity Form shortcode in the header, page, footer templates… pretty much anywhere in the theme, just add this code in your PHP file. Gravity Forms Code: You can also add the embed codes: Basic This snippet will display the form with an id of ‘1’; the title and description will not be… Read More

Add a shortcode to add_shortcode in functions.php

This drove me a little crazy one afternoon. I had to add a gravity forms shortcode to a new add_shortcode script in functions.php To accomplish this, I added this to my code: ‘ . do_shortcode($content) . ‘ Here is how it looks in its working example. I work best by watching. Too many people just… Read More

Redirect form after submit

Add the onClick values onClick values *replace f0rm with form, I didn’t want the form to render on this website.

Bulletproof / Simple Contact Form

I just need a simple contact form that always works. Less code the better. No bells or whistles. If spam becomes an issue, I can add a Google reCAPTCHA. Contact Form Code:

WordPress templates

I keep forgetting the code to create a custom WordPress template, so I’m adding it to my blog Gist