Yoink: https://stackoverflow.com/a/57484589
Thin 100
Extra Light 200
Light 300
Regular 400
Medium 500
Semi-Bold 600
<?php | |
// Yoink: https://wordpress.stackexchange.com/a/41300 | |
// Function to upload images from url to Wordpress | |
// then set the new image as a posts featured image via post ID | |
function Generate_Featured_Image( $image_url, $post_id ){ | |
$upload_dir = wp_upload_dir(); | |
$image_data = file_get_contents($image_url); | |
$filename = basename($image_url); |
<?php | |
// Yoink: https://mekshq.com/which-wordpress-template-file-used/ | |
//For example, you can paste this into your theme functions.php file | |
function meks_which_template_is_loaded() { | |
if ( is_super_admin() ) { | |
global $template; | |
print_r( $template ); | |
} | |
} |
<?php | |
// Insert code snippits to the <head> and <body> tags | |
// Useful for gtag and analytics | |
function insert_in_head() { | |
?> | |
<!-- Google Tag Manager --> | |
<!-- SCRIPT FOR GTAG --> | |
<!-- End Google Tag Manager --> |
Yoink: https://stackoverflow.com/a/57484589
Thin 100
Extra Light 200
Light 300
Regular 400
Medium 500
Semi-Bold 600
SELECT `guid`, `post_title` FROM `wp_posts` WHERE `post_content` LIKE '%[contact-form-7%'
Replace <ID HERE>
with the id number found in wp-admin
SELECT `guid`, `post_title` FROM `wp_posts` WHERE `post_content` LIKE '%[contact-form-7 id="<ID HERE>"%'
UI found in post/page in the Yoast SEO setction, under Advanced
Run this query in phpmyadmin, adminer, or what ever db client you are using.
UPDATE `wp_postmeta` SET `meta_value`='2' WHERE `meta_key`='_yoast_wpseo_meta-robots-noindex'
To view disk usage via cli.
$ df -h --total
Example Output:
Filesystem Size Used Avail Use% Mounted on
udev 992M 0 992M 0% /dev
tmpfs 201M 23M 178M 12% /run
/dev/vda7 50G 39G 8.6G 82% /
wp cli is usually installed as just wp
, but sometimes you may find it called wp-cli
instead.
/path/to/wp-rocket-settings-backup.json
is the exported json file from wp-rocket. Replace with the path and file name of the json file on your server or cluster.
$ wp package install --allow-root wp-media/wp-rocket-cli:trunk
$ wp rocket import --file=/path/to/wp-rocket-settings-backup.json
$ sudo rm -rf package-lock.json node_modules
$ sudo npm cache clean --force
$ npm install