Skip to content

Instantly share code, notes, and snippets.

Avatar

Katherine Wakefield awakekat

View GitHub Profile
@awakekat
awakekat / monthly-switch.txt
Created Feb 19, 2019
Monthly Elementor Shortcode Switch
View monthly-switch.txt
<?php $month = date('F');
switch ($month) {
case "January":
echo do_shortcode('[INSERT_ELEMENTOR id="XXX"]');
break;
case "February":
echo do_shortcode('[INSERT_ELEMENTOR id="XXX"]');
break;
case "March":
@awakekat
awakekat / daily-switch.txt
Last active Feb 19, 2019
Elementor Daily shortcode switching
View daily-switch.txt
<?php $weekday = date('l');
switch ($weekday) {
case "Monday":
echo do_shortcode('[INSERT_ELEMENTOR id="XXX"]');
break;
case "Tuesday":
echo do_shortcode('[INSERT_ELEMENTOR id="XXX"]');
break;
case "Wednesday":
@awakekat
awakekat / custom_loop_2.txt
Created Feb 17, 2019
Custom Dates WP Loop #2
View custom_loop_2.txt
<?php
/* Template Name: Services Template */
get_header(); ?>
<div id="primary" <?php astra_primary_class(); ?>>
<?php astra_primary_content_top(); ?>
<?php // CUSTOM SERVICES LOOP
$today = current_time('Ymd');
$args = array(
'post_type' => 'service',
@awakekat
awakekat / custom_loop_1.txt
Last active Feb 17, 2019
Custom WP Dated Loop
View custom_loop_1.txt
<?php
/* Template Name: Front Page Template */
get_header(); ?>
<div id="primary" <?php astra_primary_class(); ?>>
<?php astra_primary_content_top(); ?>
<div style="background-color: #F2EBCB;padding:15px 15px 0 15px;">
<h3 style="text-align:center;padding-bottom:15px;text-weight:bold;">Upcoming Sunday Services:</h3>
<div style="display:flex;flex-direction:row;width:75%;margin:0 auto;">
<?php
View WP ParentChild enqueue
/**
* Enqueue Parent and Child Styles
*/
function enqueue_styles() {
// enqueue parent styles
wp_enqueue_style('parent-theme', get_template_directory_uri() .'/style.css');
// enqueue child styles
View gist:27842b533bbd14de4a14123654d6a241
https://webdevstudios.com/2018/12/11/advanced-custom-fields-and-gutenberg/
View esnext-gutenberg-block.js
const { __, setLocaleData } = wp.i18n;
const { registerBlockType } = wp.blocks;
const blockStyle = {
backgroundColor: '#900',
color: '#fff',
padding: '20px',
};
setLocaleData( window.gutenberg_examples_01_esnext.localeData, 'gutenberg-examples' );
@awakekat
awakekat / Gutenburp blahk
Created Dec 12, 2018
Vanilla Gutenberg Block
View Gutenburp blahk
/**
* vanilla-gutenberg-block.js
*
* Hello World: Step 1
*
* Simple block, renders and saves the same content without interactivity.
*
* Using inline styles - no external stylesheet needed. Not recommended
* because all of these styles will appear in `post_content`.
*/
@awakekat
awakekat / secureinstall.txt
Last active Sep 17, 2017
Securing your installation
View secureinstall.txt
# secure install page
<Files install.php>
# Apache < 2.3
<IfModule !mod_authz_core.c>
Order allow,deny
Deny from all
Satify All
</IfModule>
# Apache >= 2.3
@awakekat
awakekat / stophotlink.txt
Created Sep 17, 2017
stop WP hotlinking
View stophotlink.txt
You can’t perform that action at this time.