php
- Analytics & Testing
How To Exclude Tags In Google Tag Manager By The Visitor’s Logged-In User Role in WordPress
Throughout any day, I log into Martech Zone to read form submissions, add and edit content, and improve the site’s performance. At issue is that I don’t want that activity skewing my analytics or executing tags within Google Tag Manager (GTM), such as opening my chatbot or detecting a visitor’s location using an IP lookup service (our chat tag fires…
- CRM and Data Platforms
Check Password Strength with JavaScript or jQuery and Regular Expressions (With Server-Side Examples, Too!)
I was doing some research on finding a good example of a Password Strength checker that uses JavaScript and Regular Expressions (Regex). In the application at my work, we do a post back to verify the password strength and it’s quite inconvenient for our users. What is Regex? A regular expression is a sequence of characters that define a search…
- Content Marketing
WordPress: How To Sort Your Custom Post Type Posts Alphabetically
With the new theme (and child theme) I’ve implemented on Martech Zone, I had to rebuild and recode the custom post type I built for Acronyms. I optimized the code to insert some additional custom fields and I’m having to redesign the archive and taxonomy templates to better display the acronyms listed. In my last theme (whose developers discontinued support),…
- Content Marketing
How To Stop WordPress From Guessing Redirects When It Believes It Will Result in a 404 Error
If you’ve been a longtime reader of Martech Zone, you’ve probably noticed that there’s a ton of progress on cleaning up the site… specifically bad internal links, tons of redirects, removal of articles to discontinued platforms, and updating of critical articles. Working nights and weekends, I’ve probably deleted over 1,000 articles and then edited over 1,000 more… and my work…
- Content Marketing
WordPress: Dynamically Include JavaScript or PHP Using the Post ID
One of the efforts that I’ve really been working on this year on Martech Zone is providing some simple web applications that are helpful to our visitors. There’s some basic development behind these that include both PHP and JavaScript (mostly jQuery). With WordPress, there’s not a really convenient way to write pages or posts with the specific code that you…
- Content Marketing
How To Syndicate External RSS Feeds In Your WordPress Theme or Child Theme
Some folks don’t realize it, but WordPress has integrated the ability to syndicate RSS feeds with some out-of-the-box features. While there are widgets to do this, you may actually want to include the ability to publish other feeds directly into your WordPress template. WordPress supports both Magpie and SimplePie RSS Caching within its available function, fetch_feed: fetch_feed – retrieve an…
- CRM and Data Platforms
Calculate or Query Great Circle Distance Between Points of Latitude and Longitude Using The Haversine Formula (PHP, JavaScript, Java, Python, MySQL, MSSQL Examples)
This month I’ve been programming quite a bit in PHP and MySQL with respect to GIS. Snooping around the net, I actually had a hard time finding some of the Geographic calculations to find the distance between two locations so I wanted to share them here. The simple way of calculating a distance between two points is using the Pythagorean…
- Content Marketing
String Locator: How To Locate Code In A WordPress Theme or Plugin
The theme Martech Zone is using is no longer supported and the developers have disappeared, so I’ve been managing development myself. It’s been quite a challenge but the theme was pretty well-developed so I’ve been able to make a ton of customizations as well as retire some of the features that I’d never be using. Most recently, my host offered…