How to Visually See What Your jQuery Selection is Selecting

I was recently working on form validation and wanted to mark a.form-group as successful if it contained a particular icon inside the label. The icon was set using PHP depending if the data existed in the database. I was writing .prev() and .parent() to try and select the wrapping .form-group but it wasn’t working and… Read more »

Continue Reading

Category: Code Snippets / Tutorials

How to Get a List of WordPress PDF, Image, Post, or Page URLS

Below are two PHP scripts you can use to help get a list of URLs of content in your WordPress site. I use these when I am migrating posts or media library files to another sites without using a plugin. Follow the steps below to use these scripts Open a text editor and copy and… Read more »

Continue Reading

Category: Code Snippets

How to Prevent One Word Lines (widow orphan) In Website Paragraphs

I am often adding padding to the left and right of paragraphs to force copy down to prevent one word on a line. Or even worse, I add <br> to a word on the line above to prevent the word by itself. But this causes issues with responsive design because the <br> changes position breaking… Read more »

Continue Reading

Category: Code Snippets

Trigger HubSpot Popup Form on Page Load or CTA Click

HubSpot provides the ability to display a pop up form with various triggers (exit intent, after 7 seconds, etc.) But what if you want to show it immediately or when a button is clicked? Below is some javascript to help achieve this functionality.

 

Continue Reading

Category: Code Snippets

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

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… Read more »

Continue Reading

Category: Code Snippets

Open All Links to PDF files in a New Window

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.

 

Continue Reading

Category: Code Snippets

Check Page Level Depth If Condition in WordPress

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

Source: Get the depth of the current page in WordPress

Continue Reading

Category: Code Snippets

HTML5 Responsive Autoplay Video Code Snippet

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

Continue Reading

Category: Code Snippets

Hide WordPress Content Editor Panel Using ACF

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

Continue Reading

Category: Code Snippets

Close Navbar When Nav Link is Clicked

By default the navbar dropdown stays open when clicked. This can be an issue if you are using name anchor’s or linking to an id like href=”#section”

Continue Reading

Category: Code Snippets