Skip to content

Instantly share code, notes, and snippets.

View loorlab's full-sized avatar
💻
💥👩‍🚀👨‍🚀💥

LOOR Lab loorlab

💻
💥👩‍🚀👨‍🚀💥
View GitHub Profile
@loorlab
loorlab / wp-cheat-sheet
Created October 20, 2015 07:28
Wordpress cheat sheets
1. Theme Structure
- style file
style.css
- header section
header.php
- main section
index.php
@loorlab
loorlab / minifier.php
Created August 7, 2023 02:44 — forked from abranhe/minifier.php
WordPress Minifier
<?php
/**
* W3C Fix and HTML minifier
* Nobody knows how this work, so don't touch it!!!
*
* https://wordpress.stackexchange.com/a/227896/129134
* https://stackoverflow.com/a/41148695
*/

.htaccess Snippets

NOTE: .htaccess files are for people that do not have rights to edit the main server configuration file. They are intrinsically slower and more complicated than using the main config. Please see the howto in the httpd documentation for further details.

Disclaimer: While dropping the snippet into an .htaccess file is most of the time sufficient, there are cases when certain modifications might be required. Use at your own risk.

IMPORTANT: Apache 2.4 introduces a few breaking changes, most notably in access control configuration. For more information, check the upgrading document as well as this issue.

Credits

What we are doing here is mostly collecting useful snippets from all over the interwebs (for example, a good chunk is from Apache Server Configs) into one

<?php
// Trigger Holiday Mode
add_action ('init', 'bbloomer_woocommerce_holiday_mode');
// Disable Cart, Checkout, Add Cart
function bbloomer_woocommerce_holiday_mode() {
@loorlab
loorlab / functions.php
Created March 18, 2023 04:58 — forked from mrwweb/functions.php
Example Child Theme Files
<?php
/*
Important!
Make sure to replace {my_} with your theme's unique prefix.
All future functions you write should use that same prefix.
Example: mrwnten_parent_theme_enqueue_styles()
*/
add_action( 'wp_enqueue_scripts', '{my_}parent_theme_enqueue_styles' );
@loorlab
loorlab / wp-cli-shared-hosting_WP.md
Last active September 21, 2022 02:21 — forked from mklasen/Instructions.MD
Install WP-CLI on Shared Hosting (Antagonist) + Ultimate Linux Hosting With cPanel (GoDaddy)

Download WP-CLI

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Test to see if it works correctly

php wp-cli.phar --info

Add extra permissions

@loorlab
loorlab / Custom-Pagination
Last active July 21, 2022 14:02
Pagination for custom post template wordpress
<?php
//Add custom_pagination function in your function.php file
function custom_pagination($numpages = '', $pagerange = '', $paged='') {
if (empty($pagerange)) {
$pagerange = 2;
}
global $paged;
if (empty($paged)) {
$paged = 1;
@loorlab
loorlab / Exiftool-Cheatsheet.md
Last active May 14, 2022 20:23 — forked from rjames86/My Exiftool Cheatsheet.md
Exiftool Cheatsheet

Last updated: 2022-05-14

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@loorlab
loorlab / gist:bf278a708fb6deebeeb4367a476838d6
Created March 24, 2022 01:22 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
<div class="form-group">
<label for="departamento"><strong>DEPARTAMENTO</strong></label>
<select class="form-control" id="departamento" name="departamento" required>
<option value = ""> </option>
<option value = "Amazonas">Amazonas</option>
<option value = "Antioquia">Antioquia</option>
<option value = "Arauca">Arauca</option>
<option value = "Atlántico">Atlántico</option>
<option value = "Bolívar">Bolívar</option>
<option value = "Boyacá">Boyacá</option>