Skip to content

Instantly share code, notes, and snippets.

@awakekat
awakekat / monthly-switch.txt
Created February 19, 2019 17:29
Monthly Elementor Shortcode Switch
<?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 February 19, 2019 17:28
Elementor Daily shortcode switching
<?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 February 17, 2019 20:12
Custom Dates WP Loop #2
<?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 February 17, 2019 20:13
Custom WP Dated Loop
<?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
/**
* 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
@awakekat
awakekat / gist:27842b533bbd14de4a14123654d6a241
Created December 12, 2018 21:17
Address for Gutenberg Block code
https://webdevstudios.com/2018/12/11/advanced-custom-fields-and-gutenberg/
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 December 12, 2018 21:14
Vanilla Gutenberg Block
/**
* 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 September 17, 2017 15:14
Securing your installation
# 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 September 17, 2017 15:09
stop WP hotlinking