This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*--------------------------------------------------------------------------- | |
* Label + input display fix | |
* Put the input + text inside the label to make it works correctly | |
*--------------------------------------------------------------------------*/ | |
label { | |
display: block; | |
padding-left: 15px; | |
text-indent: -15px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Custom Loop Add to Cart. | |
* | |
* Template with quantity and ajax. | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. | |
global $product; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function($) { | |
var JA_Custom_Validation = { | |
/** | |
* Start the engine. | |
* | |
* @since 1.0.0 | |
*/ | |
init: function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// enqueue these scripts and styles before admin_head | |
wp_enqueue_script( 'jquery-ui-dialog' ); // jquery and jquery-ui should be dependencies, didn't check though... | |
wp_enqueue_style( 'wp-jquery-ui-dialog' ); | |
?> | |
<!-- The modal / dialog box, hidden somewhere near the footer --> | |
<div id="my-dialog" class="hidden" style="max-width:800px"> | |
<h3>Dialog content</h3> | |
<p>This is some terribly exciting content inside this dialog. Don't you agree?</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function enqueue_select2_jquery() { | |
wp_register_style( 'select2css', '//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.css', false, '1.0', 'all' ); | |
wp_register_script( 'select2', '//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.js', array( 'jquery' ), '1.0', true ); | |
wp_enqueue_style( 'select2css' ); | |
wp_enqueue_script( 'select2' ); | |
} | |
add_action( 'admin_enqueue_scripts', 'enqueue_select2_jquery' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) === | |
# | |
# by Fotis Evangelou, developer of Engintron (engintron.com) | |
# | |
# ~ Updated December 2021 ~ | |
# | |
# | |
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores. | |
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/cache/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* code to check if logged in to a different WP site example.com */ | |
$logged_in_cookie = 'wordpress_logged_in_' . md5( 'https://example.com' ); | |
if ( ! isset($_COOKIE[ $logged_in_cookie ]) ) { | |
// display adverts | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "digitalocean_token" { | |
description = "This is the Digitalocean API-token which is used to setup the machines." | |
} | |
variable "digitalocean_region" { | |
description = "For example: nyc1, nyc2, ams2, ams3, fra2" | |
default = "fra1" | |
} | |
variable "digitalocean_dokku_size" { | |
description = "Instance size: 512mb, 1gb, 2gb, 4gb ..." | |
default = "2gb" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# CALCULATE THIS WEEK'S DATES #} | |
{% set todayNum = 'now' | date('w') %} | |
{% set startDate = 'now' | date_modify('-' ~ todayNum ~ ' day') %} | |
{% set endDate = startDate | date_modify('+6 day') %} | |
{% set endDateFormatted = '-' ~ endDate | date('j') %} | |
{% if startDate | date('M') != endDate | date('M') %} | |
{% set endDateFormatted = ' - ' ~ endDate | date('M j') %} | |
{% endif %} | |
<p>The Week of {{ startDate | date('M j') }}{{ endDateFormatted }}</p> |