Function
Martech Zone articles tagged function:
-
Content Marketing
WordPress: How to 301 Redirect Pagination Pages to the Parent URL
It may be anecdotal, but I’m finding that Google Search Console is becoming more comprehensive in its reporting. So much so that I’ve begun to lean on it more and more… especially to identify pages not found on the site that might negatively impact search rankings. My site’s theme incorporates an approach where visitors can click load more if they’d…
-
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’re a longtime reader of Martech Zone, you’ve probably noticed much progress on cleaning up the site. I’ve been correcting incorrect internal links, adding many redirects, removing articles to discontinued platforms, and updating critical articles. Working nights and weekends, I’ve probably deleted over 1,000 articles and edited over 1,000 more… and my work isn’t done. Another functional change I’ve…
-
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
Redirect WordPress in Header
The redirection plugin built for WordPress is a fantastic means of organizing and managing redirects. I use it on this site and have organized my groups of redirects for updated posts, affiliate links, downloads, etc. However, I ran into a unique problem where I have a reverse proxy set up for a client where WordPress is running at a path……
-
Content Marketing
PHP: Using Is.gd API to Shorten URL
Just read an article on the benefits and pitfalls of shortening URLs over at SEOmoz. I utilize the Is.gd API to do this: function doCurlRequest($url, $variable, $value) { $api = $url."?".$variable."=".$value; $session = curl_init(); curl_setopt($session, CURLOPT_URL, $api); curl_setopt($session, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($session); curl_close($session); return $data; } function doShortenURL($longurl) { $url = "http://is.gd/api.php"; $variable = "longurl"; $shorturl = doCurlRequest($url, $variable,…