Skip to content

Instantly share code, notes, and snippets.

View Magnacarter's full-sized avatar

Adam Carter Magnacarter

  • React and WordPress Dev
  • United States
View GitHub Profile
<?php
/**
* Plugin Name: UNICEF Tap Project Banner
* Plugin URI: http://adamkristopher.com/unicef-tap-project-banner/
* Description: Displays a simple donate banner in the header or footer of your website so your visitors can participate in the UNICEF Tap Project. Learn more at https://thewaterproject.org
* Version: 0.1.0
* Author: Adam Carter & Frankie Jarrett
* Author URI: http://adamkristopher.com, http://fjarrett.com
* License: GPLv2+
* Text Domain: unicef-tap-project-banner
@Magnacarter
Magnacarter / filepath.php
Created December 17, 2014 06:59
EZ File Path
<?php
/**
*use this for file paths.
*@param string
*
*@return string
*/
function ez_file_path( $file ) {
$host = $_SERVER[ "HTTP_HOST" ];
$path = rtrim ( dirname( $_SERVER[ "PHP_SELF" ] ), "/\\" );
@Magnacarter
Magnacarter / .bash_profile
Last active November 1, 2022 19:32
Bash profile with great shortcuts.
source ~/.profile
# ------------------------------------------------------------
# Set paths
# ------------------------------------------------------------
export PATH="/usr/local/bin:$PATH"
export PATH="$PATH:$HOME/.composer/vendor/bin"
export PATH=~/.npm-global/bin:$PATH
# ------------------------------------------------------------
@Magnacarter
Magnacarter / File Paths
Created December 17, 2014 23:02
EZ File paths.
<?php
/**
*use this for file paths.
*@param string
*
*@return string
*/
function ez_file_path( $file ) {
$host = $_SERVER[ "HTTP_HOST" ];
$path = rtrim ( dirname( $_SERVER[ "PHP_SELF" ] ), "/\\" );
@Magnacarter
Magnacarter / Light Box
Created December 17, 2014 23:43
How to create a lightbox.
/*
*jquery - Lightbox
*/
//Problem: User, when clicking on an image goes to a dead end.
//Solution: Create a large overlay when the user clicks the image. -Lightbox
//By placing the div in the app.js file we are using unobtrusive jquery.
var $overlay = $('<div id="overlay"></div>');
var $image = $("<img>");
@Magnacarter
Magnacarter / registration.php
Created December 18, 2014 23:27
General registration form w/ hidden nonce field for WordPress
<?php
/**
*
*General registration form
*
*
*/
?>
<form method="post">
<?php
/**
* Template Name: Home
*/
/**
* Remove the Genesis custom loop and add custom template
*
* @action genesis_loop
*
/**
* Remove the Genesis custom loop and add custom template
*
* Added a counter to my WordPress loop to avoid having to use the Genesis Grid Loop
*
* @action genesis_loop
*
* @return void
*/
function rjs_portfolio_loop() {
@Magnacarter
Magnacarter / category.php
Created May 24, 2015 22:36
Single category page
<?php
/*
* Single Categories
*/
get_header() ?>
<section id="categories">
<div class="gallery-categories grid-100">
<ul>
function demo_enqueue_scripts() {
// Theme CSS
wp_enqueue_style( 'demo-animate' , get_template_directory_uri() . '/css/animate.min.css');
// Theme JS
wp_enqueue_script( 'deom-lazyloadxt' , get_template_directory_uri() . '/js/jquery.lazyloadxt.js', array('jquery'), '' , true);
}
add_action( 'wp_enqueue_scripts', 'demo_enqueue_scripts' );