15 Tags Found For: “snippet

Divi Coming Soon page plugin FREE from DiviLife

This free plugin from DiviLife is wonderful. Coupled with the power of Divi’s Theme Builder you can redirect visitors to a page built with Divi. The Theme Builder comes into play as you can easily remove/hide site menus or footers from your bespoke coming soon...

Stop Divi Gallery Images From Cropping Using Functions

Currently the only options for the built-in Divi photo gallery are for “portrait” or “landscape” thumbnails, which means any aspect ratio outside of those will be cut off or cropped. The following snippet allows the thumbnail in the photo...

Gravity Forms User Role Menu Restriction/Hide

Insert into your theme or child theme functions file: /* ------------------------- GRAVITY FORMS ROLES --- */ $role = get_role('editor'); $role->add_cap('gform_full_access'); add_action('admin_menu', function () { $user = new WP_User(get_current_user_id()); if...

Divi: Remove Projects From View in WordPress Admin Area

This code snippet doesn’t disable Divi’s own custom post type called Projects, but rather just removes it from view in the admin area. For numerous reasons you don’t want to remove the Projects custom post type (screwed up templates, time outs, etc.)...

Remove Divi Builder Button for WP User Role Author

To make things easier for the client hand-off, I removed the Divi builder button from the back-end, using the following code: /* Remove Divi Builder button for WP Role Author */ function my_custom_admin_head() { if ( current_user_can( 'author' )) :...

Divi Disable Slider and Gallery Slide-In Effect

On page load the Divi photo gallery and the image slider have their own automatic “slide in from left” effect. To disable this effect use the following CSS: .et_pb_slide_image, .et_pb_slide:first-child .et_pb_slide_image img.active {...

Force HTTPS But Not For Add-On Domain

Setting up a new add-on domain* for a client today and found that I could not access the new add-on domain name directly. It was appending the new add-on domain name to the root or main site url. So instead of taking the visitor to www.newdomain.com it was taking them...

Fix Dreamweaver Double-Spaced Code

  Due to Unix/Linux/Windows server environments, when you are editing code locally in Dreamweaver you’ll sometimes find your code double-spaced for the whole file. A quick fix is to run this find/replace command to remove the extra spaces. In Dreamweaver:...

InMotion Hosting: Fix Image Upload Error for WordPress

This may be pertinent for WordPress installs on InMotion web hosting only. I ran into an image upload error for a new WordPress install where the only message displayed was “HTTP error”. After following the usual actions of checking folder permissions, php...

PHP Snippet: Display If In Date Range

One of my client’s websites requires regular updates where a “Sale” graphic is shown to visitors between certain dates. Rather than manually updating the site at those specific dates (and having to be in front of the computer on those dates) I wrote...

Lazy Load Your Images To Significantly Speed Up Page Load Times

I’d seen the effect on other pages while surfing the web for some time now. Where you are scrolling down and the images load into view as the page is scrolling down. I immediately knew when seeing the effect in action just how beneficial this is. For one thing...

Invisible Elements Correctly in CSS

.element-invisible { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ clip: rect(1px, 1px, 1px, 1px); } Full credit to Jonathan Snook. His article and reasoning here:...