Quick code to define what content shows up based on page type. I had to have different containers show up depending on page. The Code
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.
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:
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:
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
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: <?php echo do_shortcode(‘[gravityf0rm id=1 name=ContactUs title=false description=false]’); ?> You can also add the embed codes: Basic <?php gravity_form( 1, false, false, false, ”, false ); ?> This snippet will… Read More
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
Add the onClick values onClick values *replace f0rm with form, I didn’t want the form to render on this website.
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:
I keep forgetting the code to create a custom WordPress template, so I’m adding it to my blog Gist