Wordpress Tips, Tricks and Reusable Bits of Code

Using Beaver Builder and Restrict Content Pro together

Whenever I need to create a membership site, I use Restrict Content Pro. I like that it is powerful and extensible, but also relatively straightforward without a lot of front end bloat. The shortcodes for controlling visibility of content also allow for a lot of granularity. I’m sure many other membership plugins are great but…

How to check a google workspace account with gmail using POP

By default this will not work and no matter what you do, you’ll always get “Server denied POP3 access for the given username and password”. The following article actually worked for me: https://support.google.com/mail/thread/8805971/server-denied-pop3-access-for-the-given-username-and-password-i-have-tried-everything-need-help?hl=en Specifically, here are his steps (I did not have 2FA turned on so I only needed the first half) 0 – sign…

Stripe webhooks being blocked by htaccess blacklist

For anyone else that stumbles on this issue… I have a client website that uses Gravity Forms to subscribe users to a monthly subscription. It has been working fine for almost a decade. But then suddenly a couple of weeks ago (approximately Sept 1 2021) all his webhook requests began to fail. Recurring invoices and…

Change Beaver Bulider Posts module query in functions.php

I had a site where we had a member dashboard, on which we showed a variety of information, including any posts that the user had published. default Beaver Builder posts module can filter by user but only if you type in the user ID. It doesn’t have an easy way to simply grab the *current*…

How to let users manage Stripe subscriptions created with Gravity Forms

I have been doing some research for a client about what it would take to allow people who have signed up for recurring donations to be able to manage their donations (cancel, change amount, or update credit card details). And I found a solution that I wanted to share, for anyone looking for ways to…

Get Beaver Builder links to align perfectly with top of full height rows

When you do a layout that has a series of full height rows with arrows to navigate between them (kind of like this) you may notice that it doesn’t go exactly to the top of the next row but just slightly above it. This is something they built in on purpose to account for fixed…

Facebook Pixel causing WordPress media search to not work properly

Note to self but if you are helped by it then great. 🙂 I had a site where for some reason the media search wasn’t working. It was not actually filtering things like it should and just sort of re-arranged all the same results (but did not narrow them, no matter how specific my search…

If you get COR errors on fonts, turn off Combine CSS in cache settings

Note to self (and if it helps someone else that’s great) I had a very standard Beaver Builder site (but with one custom font) with the typical setup including UABB. I enabled SSL yesterday but today it still was having mixed content problems. At one point I saw this error text: “No ‘Access-Control-Allow-Origin’ header is…

Scheduling WooCommerce sale dates

I was surprised by how hard it was to find this seemingly fundamental piece of information: when you schedule a product to be on sale to and from specified dates, does the sale go THROUGH the last day listed, or UP UNTIL the last day listed? I submitted a ticket and even he had to…

How to tell if an email is a scam or phishing

I often get emails from clients asking me about the legitimacy of messages they get, and here are a couple of common ones that I wanted to bring to your attention: 1) Fake Domain Expirations: A common scam is from companies warning you that your domain is about to expire, and trying to get you…

Create a Stripe customer without capturing a charge

A small but important difference between the Gravity Forms +Stripe plugin from Gravity+ vs the “official” Stripe addon by Gravity forms, is that the latter does not automatically create a Stripe customer on Products/Services charges. This means you do not have access to customer payment info, for example if your form charges a deposit and…

Prevent a nav menu empty parent link from being followed

When you have a parent item in a nav menu that you want to leave blank, but not scroll to the top of the page when clicked, use #! instead of just #.

disable default image linking to itself

When you insert an image by default it creates a link to itself. So this usually results in being taken to a page containing just the image and nothing else, so the user has to click the back button. Not a great user experience in my opinion. So this will get rid of that so…

Customize the “protected post” text

Password protected pages are such a great feature of WordPress (under-used, probably too) but one of the things I don’t like about them is the text it puts in the title that says “Protected:” or “Private:.” Well if you ever want to get rid of that here is a little something to add to your…

make something stretch to full width of browser inside of a fixed width element

Just ran into this the other day and it saved me a ton of work. (I was prepared to have to end the fixed width div just to put this menu in and then start a new fixed width div below it. Using this method I did it all in CSS without having to change…

Hide the annoying bubble on google maps

Sometimes you want to embed a google map but have it sized small. By default, it still has the big dumb location bubble that pops up, but because the map is small, it is cut off. It looks dumb. Well here’s how to get rid of it so that you just have the red pin.…

Dynamcially resize images for mobile users

Been looking for something like this for a long time! “TinySrc is now a part of Sencha.io. It will remain a free service for single users, known as Sencha.io Src. Sencha.io Src performs smart sizing of images for efficient mobile delivery. Sencha.io Src helps you dynamically resize images for the ever increasing number of mobile…

Prevent a plugin from automatically updating itself

Got a plugin that you don’t want your client to update? Insert this bit of code at the end of the plugin and it will not check to see if there is an updated version (thus getting rid of the reminders) add_filter(‘site_transient_update_plugins’, ‘dd_remove_update_nag’); function dd_remove_update_nag($value) { unset($value->response[ plugin_basename(__FILE__) ]); return $value; }

frequently used wordpress tags

STYLE.CSS HEADER /* Theme Name: My Site name Description: an awesome theme that I built Author: Your name Author URI: http://www.yoursite.com */ HEADER STUFF head tags

vertically align something to the bottom of the container element

this will snap an element to the bottom of the parent element. first, make sure the parent element is set to {position:relative} then set the child element to {position:fixed; bottom:0;}

Load plugin scripts only on pages that need them

To disable messy plugin from loading on every page of your site (just on the pages that need it)… First find the handle — Open the php for the script you want to turn off and look for where it adds itself via enqueue_script wp_enqueue_script(‘wpng-calendar‘, get_bloginfo(‘wpurl’) . ‘/wp-content/plugins/wpng-calendar/js/functions.js’, array(‘date-js’), ’0.85′); (if the plugin doesn’t use…