WordPress solutions for agencies and small businesses

Hi, my name is Alex Mansfield. I partner with agencies and small businesses to design, develop, and maintain high quality WordPress websites.

Latest Posts

Beaver Builder, FacetWP, and Infinite Scroll

For some reason, FacetWP doesn’t support infinite scroll when paired with the Posts module in Beaver Builder. However, working with some code from GitHub, I was able to modify it to work with Beaver Builder. Here is the code: (function( $ ) { ‘use-strict’; var throttleTimer = null; var throttleDelay = 100; $(function() { var […]

How to Filter Canonical URLs in WordPress

The canonical URL can be modified programmatically in WordPress using the get_canonical_url filter hook. Recently I was working on a site that needed custom canonical URLs on specific search result pages. I went looking for the documentation on filtering the canonical URLs, but while the existence of the filter is documented, I could not find […]

Styling links based on partial URLs with CSS

Sometimes you just want to style all the links pointing to a certain site, or containing a certain string in the URL. For example, styling all links to Wikipedia to stand out from regular links or hiding all links that include “registration” in the URL. It’s just a matter of using: href*= in the CSS […]

Setting a Custom Post Type Archive as the Home Page

It took me quite a bit of research to figure out how to modify the home page query to use a custom post type archive. Here’s what it takes… 1. Set the home page to display a static page On the Settings > Reading page, make sure the “Your homepage displays” option is set to […]

Preventing Widows/Orphans with Vanilla Javascript

What is a Widow/Orphan? When referring to text on a website, a “widow” or an “orphan” refers to the final word of a heading or paragraph that wraps to its own line. Like this: To prevent this from happening, we can use the HTML entity for non-breaking spaces between the last two words: A non-breaking […]

Overcoming the “Cross-Origin Request Blocked” error in PHP

I was making an AJAX call and was getting a “Cross-Origin Request Blocked” error. It wasn’t clear where this error was originating, so I did a little research and here’s what I came up with. When the server determines that the script making the AJAX request is on a different domain, depending on the server […]