Skip to content

Instantly share code, notes, and snippets.

View watsonad's full-sized avatar

Anthony Watson watsonad

  • MW Arts
  • Allison Park, PA
View GitHub Profile
@watsonad
watsonad / ajax.php
Created April 26, 2017 20:55 — forked from sniperwolf/ajax.php
Super-Simple WordPress ajax post-popup with jQuery and Reveal plugin
<?php
/**
* Template Name: ajax
*/
?>
<?php
$post = get_post($_GET['id']);
?>
<?php if ($post) : ?>
<?php setup_postdata($post); ?>
@watsonad
watsonad / wp-admin-modal-dialog.php
Created April 26, 2017 20:52 — forked from anttiviljami/wp-admin-modal-dialog.php
WordPress admin modal dialog example
<?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>
# Wordpress
*.log
.htaccess
sitemap.xml
sitemap.xml.gz
wp-config.php
wp-content/advanced-cache.php
wp-content/backup-db/
wp-content/backups/
wp-content/blogs.dir/
@watsonad
watsonad / wp_mail_smtp.php
Created November 22, 2016 03:21 — forked from butlerblog/wp_config.php
Configure WordPress wp_mail function to send through SMTP server http://b.utler.co/Y3
/**
* This function will connect wp_mail to your authenticated
* SMTP server. This improves reliability of wp_mail, and
* avoids many potential problems.
*
* Author: Chad Butler
* Author URI: http://butlerblog.com
*
* For more information and instructions, see:
* http://b.utler.co/Y3
<?php
/* Template Name:
* Template URI:
* Author: Anthony Watson
* Author URI: http://www.mw-arts.com
* Description:
*/
?>
@watsonad
watsonad / high-dpi-media.css
Created January 4, 2016 21:24 — forked from wylieconlon/high-dpi-media.css
A CSS media query that captures almost all high DPI aware devices.
/* -------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs with IE zoomed in */
/* - Android hdpi devices and above */
/* - Android tvdpi devices, including Google Nexus 7 */
@watsonad
watsonad / WP Custom Post
Created October 28, 2015 23:34
PHP: WP Create Custom Post
// Create custom post type:
add_action('init', 'prefix_create_post');
function prefix_create_post() {
$labels = array(
'name' => '',
'singular_name' => '',
'add_new' => 'Add new',
'add_new_item' => 'Add new ',
'edit_item' => 'Edit ',
@watsonad
watsonad / gist:0ca46249b252c9ad1a07
Last active January 22, 2016 16:48
PHP: WP Plugin Header
<?php
/* Plugin Name: HHSPFA Board
* Plugin URI:
* Description: Front-end and back-end code for managing HHSPFA board members and committees.
* Author: Anthony Watson
* Version: 0.1
* Author URI: http://www.mw-arts.com
*/
?>
@watsonad
watsonad / htmlBaseSnippet
Created October 26, 2015 15:04
HMTL: Base
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>