How to Redirect Known Pages and Wildcard for Everything Else with htaccess

Category: Code Snippets

I recently worked on a project which needed me to shut down a WordPress blog and migrate it’s content. I had about 20 posts and pages that were going to migrate but everything else was going to be deleted. Since htaccess runs their commands from the top to the bottom, place your known redirects above […]

Continue Reading

Open All Links to PDF files in a New Window

Category: Code Snippets

This finds all of the links pointing to PDF files and opens them in a new window. If you are using Chrome, you will need to enable popups for this to work. $(“a[href$=’.pdf’]”).each(function () { window.open($(this).attr(‘href’),”_blank”); });  

Continue Reading

Check Page Level Depth If Condition in WordPress

Category: Code Snippets

The code snippet below is handy when you are trying to check if the current page is a parent or a child in a WordPress theme. You can then use the conditional to output different code depending on the page depth it is <?php // gets page depth global $wp_query; $object = $wp_query->get_queried_object(); $parent_id = […]

Continue Reading

HTML5 Responsive Autoplay Video Code Snippet

Category: Code Snippets

In order to make your HTML5 video responsive you will need to add the following CSS style properties: width: 100%, and max-height: 100%. Your browser does not support the video tag.

Continue Reading

Hide WordPress Content Editor Panel Using ACF

Category: Code Snippets

Add the code snippet below into your functions.php file to hide the default WordPress content meta box. Source

Continue Reading

Yoast Breadcrumbs CSS Styles for WordPress Templates

Category: Code Snippets

The Yoast SEO plugin is great and offers a nice breadcrumbs snippet. Unfortunately, there is not an easy way to add a wrapper ID or class to the breadcrumbs for styling. Follow the steps below to change that.

Continue Reading