All posts by acrane
Import SQL Database into MAMP by the command line
The file might be too big so you might have to import it by the command line.
You’ll be asked for the password. Most of the time with MAMP the user and pass are “root”.
WordPress Prevent Author Lookup
Change color of an Object in photoshop
This is if you have a single color icon and you need to change it to a specific other colors.
Step 1: Create new fill color that you want in a layer above your icon.
Step 2: Right click on the fill layer and select, “Create Clipping Mask”.
Fin
How to SSH into Digital Ocean when using SpinupWP
Spinupwp is a great new way to manage WordPress sites on Digital Ocean. Fortunately or Unfortunately, they handle access to the server in a more limited version that dealing directly with Digital Ocean.
Cutting to the chase, Spinupwp will not let you access the server via ssh with the root user or with password authentication.
You must set up ssh keys. After you’ve set up the keys, you must set up a sudo user.
Once you’ve done these two steps, you’re free to ssh into your Digital Ocean server using the sudo user. It will look something like the following:
ssh sudo_user_name@server_ip_address
htaccess Force https
If someone comes to your site with a non-secure link it will not render as secure. You can add a couple lines to your htaccess that will force a secure connection. After the “RewriteEngine On” line, put the following 2 lines. Be sure to change “example” to your domain.
Add Multiple Google Captcha per page and disable submit button until verify
This will show you how to add multiple Google Captcha per page and disable the submit button until the user clicks and verify’s that they are not a robot.
First, we create the forms. You can follow along in the comments how to setup the ID’s that we will target later to render the Captcha
Second, before the end of your web page, we will include the required javascript from Google Captcha.
<script src=”https://www.google.com/recaptcha/api.js?onload=myCallBack&render=explicit” async defer></script>
Third, between the <head></head> tags, insert the following functions that will render your Google Captcha. Important things to note:
- there are test keys you can uncomment to test locally on your computer, but you must switch those to your own keys in production
- your function, “myCallBack” is called from the script you included above before the end of your file. You are going to do this in render mode, so that also needs to be in the script call above.
Above the myCallBack function, in the same script tags, place the following functions that will enable your submit button to be clicked when a user successfully clicks the captcha.
Finally, we need to disable the submit button before the user clicks on the captcha. Do that by placing the following at the end of your webpage before the call to the Google Captcha script.
And this is what it looks like all together. If you need to see other ways to render with other parameters, you can do so at Google’s documentation.
How to move the Yoast SEO Meta Box to the bottom
Place this in your theme’s functions.php file.
Display Primary Category using Yoast’s Make Primary feature
Using Yoast’s Make Primary Category Term feature, you can use it for Categories or Custom Taxonomies in your template files.
Change Last Word of a Title with CSS and jQuery
Easily change the color of the last word in a title with some simple css and jQuery. In this example, the word, “Title” in My Cool Title will be red.
The html:
The Css:
The jQuery: