Skip to content

Instantly share code, notes, and snippets.

View endurain's full-sized avatar
😃
crush!

Zac Sanders endurain

😃
crush!
View GitHub Profile
<?php
/*
Template Name: Home
*/
get_header("booking-button"); ?>
<h1 style="text-align:center;padding-top:30px;">Cathedral Plumbing Tips, Tricks & How-Tos</h1>
<?php if ( have_posts() ) : ?>
<?php
<?php
echo '<span style="color: #ffffff;">'.date('F j, Y', time()+259200).'</span>';
$(".footFacebook img").mouseenter(function(){
$(this).attr('src','/wp-content/uploads/2019/12/social_facebook_hvr.svg');
});
$(".footFacebook img").mouseleave(function(){
$(this).attr('src','/wp-content/uploads/2019/12/social_facebook.svg');
});
@endurain
endurain / wptestingfunction
Created November 23, 2019 19:45
Just a simple testing function I wrote. It will test if a function is firing two different ways.
//place in plugin
function myplugin_cron_function() {
//how I verfied function executes correctly via the following two actions
echo '<h3>Recent Posts!!!!</h3>';//input this html into /index.php template
// see if fires via email notification
wp_mail('zacharyjsanders@gmail.com','Cron Worked', date('r'));//send me an email every 30s, which it does
}
<div style="display: flex; align-items:center;justify-content:center;">
<span style="margin-right: 4px;font-size:10px;">Done right by </span>
<a href="https://witdelivers.com" target="_blank">
<svg width="58" height="18" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 58 18">
<g fill="none" fill-rule="evenodd">
<path fill="#ffffff" d="M34.699 7.8393h-.46226l-.76841-1.8379c-.038898-.095417-.083353-.23557-.083353-.23557h-.011287s-.038898.14016-.077796.23557l-.77414 1.8379h-.46209l-1.4868-3.2611c-.011114-.022369-.022228-.050505-.022228-.067456 0-.016777.011114-.033728.044629-.033728h.66804c.06703 0 .078144 0 .11166.073049l.7514 1.6083c.083527.17371.17834.4874.17834.4874h.022228s.055569-.21285.13371-.39216l.74046-1.7766h.35634l.74063 1.7766c.07797.18472.13354.39216.13354.39216h.022401s.094641-.31369.17817-.4874l.75174-1.6083c.033341-.067282.044455-.073049.11114-.073049h.66822c.033341 0 .044629.016951.044629.033728 0 .016951-.011288.045087-.022228.067456l-1.4866 3.2611M38.52
@endurain
endurain / registeroptionspagecustom
Last active October 4, 2019 05:10
Use to create an custom options page for ACF fields to live. For example, the code below creates a Theme options page for acf fields to config header and footer settings. Place in theme's functions.php NOTE: ACF PRO MUST BE INSTALLED FOR THIS TO WOR
//////////////////////////////////////////////////////////////////
// ACF Custom Functions
//////////////////////////////////////////////////////////////////
//Register Options page & Add Custom Sub-Sections
add_action('admin_menu', 'add_options_pages');
function add_options_pages() {
if (!function_exists('acf_add_options_page')) {
return;
}
@endurain
endurain / createwidgets
Last active October 4, 2019 04:37
Place this code into theme's function.php file to create widgets Then place this is the template to show content <?php dynamic_sidebar( 'Footer Logo Col 1' ); ?>
//////////////////////////////////////////////////////////////////
// Register Widget Areas
//////////////////////////////////////////////////////////////////
if (function_exists('register_sidebar')) {
register_sidebar(array(
'name'=> 'Sidebar 1',
'id' => 'sidebar1',
'before_widget' => '<article id="%1$s" class="widget %2$s">',
'after_widget' => '</article>',
@endurain
endurain / youtuberesponsivelightbox
Last active October 3, 2019 22:55
working codepen here for credit: https://codepen.io/darcyvoutt/pen/MaamWg really easy and straight-forward YT lightbox. If you're having issues getting the video to load, check the Iframe source. Make sure it has 'embed' in the src. Safari: if lay
/****HTML****/
<div id="container">
<center>
<p>Open the lightbox with below button</p>
<button id="playme" onclick="revealVideo('video','youtube')">Play Video</button>
</center>
</div>
<div id="video" class="lightbox" onclick="hideVideo('video','youtube')">
@endurain
endurain / videopopup
Created September 21, 2019 14:52
jquery video popup that can be used to show a video on popup. Place this code directly in the file/template that it is to be used on (homepage.php) for example.
<script>
jQuery(document).ready(function($){
$(function() {
overlay.init();
});
@endurain
endurain / jquery
Last active October 14, 2019 13:49
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
jQuery(document).ready(function ($) {
// Your code here
});
$(document).ready(function() {
// executes when HTML-Document is loaded and DOM is ready
console.log("document is ready");