Skip to content

Instantly share code, notes, and snippets.

View Lovor01's full-sized avatar

Lovro Hrust Lovor01

  • makeITeasy
  • Zagreb
View GitHub Profile
@Lovor01
Lovor01 / .htaccess
Last active April 8, 2020 18:06 — forked from Darep/.htaccess
PHP CSS&JS auto-versioning function.
# CSS/JS auto-versioning
RewriteEngine On
RewriteRule ^(.*)\.[\d]{10}\.(css|js)$ $1.$2 [L]
@Lovor01
Lovor01 / Embed google fonts in WordPress
Last active January 8, 2021 09:21
A list of functions.php essential things
// google fonts
wp_enqueue_style( 'google_fonts', 'https://fonts.googleapis.com/css2?family=Encode+Sans:wght@400;600&family=Spectral&display=swap', array(), null );
magick mogrify -format jpg -quality 95 -path "C:\Users\Lovro\Documents\Posao\Link2\Piranesi\Optimizirane slike" *.tif
wp media regenerate
UPDATE `topomati_cp1`.`cp_options` SET `option_value` =
(SELECT `option_value` FROM `topomati_cp_hr`.`cp_options` WHERE `option_name` = 'wpb_js_templates')
WHERE `option_name` = 'wpb_js_templates';
//Windows!
mysqldump --user=root --all-databases --result-file=name
//without result-file (using > filename) output goes to UTF16LE, which mysql cannot load!!!
1. Create new column in table wp_terms
2. add filter get_terms_orderby which returns 't.<created column>', where created column is created column in wp_terms
wp search-replace 'http://example.test' 'http://example.com' --skip-columns=guid --dry-run
--dry-run //for dry run
--export=database.sql // for export database
//get post or page slug
get_post_field( 'post_name' ) // second parameter of post ID could be added
//set automatic updates: https://wordpress.org/support/article/configuring-automatic-background-updates/
@Lovor01
Lovor01 / core-blocks.md
Last active October 24, 2021 00:06 — forked from DavidPeralvarez/core-blocks.txt
Gutenberg core blocks list