Skip to content

Instantly share code, notes, and snippets.

View johnbuck's full-sized avatar

John Buckingham johnbuck

View GitHub Profile
@johnbuck
johnbuck / enqueue-magnific-popup.php
Last active August 22, 2020 15:28
Register and enqueue Magnific Popup (http://dimsemenov.com/plugins/magnific-popup/) scripts and styles, rather than calling them explicitly in the HEAD or footer. See http://ajtroxell.com/use-magnific-popup-with-wordpress-now/ for instructions on adding Magnific Popup to your WordPress theme or child theme.
<?php
//Add this to your functions.php file in your theme or child theme
add_action('wp_enqueue_scripts', 'enqueue_magnific_popup_styles');
function enqueue_magnific_popup_styles() {
wp_register_style( 'magnific_popup_style', get_stylesheet_directory_uri() . '/magnific-popup/magnific-popup.css' );
wp_enqueue_style( 'magnific_popup_style' );
}
add_action('wp_enqueue_scripts', 'enqueue_magnific_popup_scripts');
function enqueue_magnific_popup_scripts() {
@johnbuck
johnbuck / change-woo-archive-title.php
Last active August 29, 2015 14:01
Remove "Archive" from Testimonials Post Archive page using Canvas
/* Change Archive Template H1 */
add_filter( 'woo_archive_title', 'change_testimonial_archive_title' );
function change_testimonial_archive_title( $title ) {
if ( is_post_type_archive( 'testimonial' )) {
$title = '<h1 class="archive_header">'. __( 'Testimonials', 'woothemes' ) .'</h1>'; // now display the category only
}
return $title;
@johnbuck
johnbuck / change-projects-columns.php
Created May 29, 2014 05:27
Change the number of columns displayed by the Projects by WooThemes plugin
add_filter( 'projects_loop_columns', 'change_projects_columns', 99 );
function change_projects_columns( $columns ) {
$cols = 3;
return $columns;
}
@johnbuck
johnbuck / robots.txt
Created June 12, 2014 21:21
An example robots.txt for WordPress
User-agent: *
Disallow: /feed/
Disallow: /trackback/
Disallow: /wp-admin/
Disallow: /wp-content/
Disallow: /wp-includes/
Disallow: /xmlrpc.php
Disallow: /wp-
Allow: /wp-content/uploads/
.gform_wrapper input[type=text], .gform_wrapper input[type=url], .gform_wrapper input[type=email], .gform_wrapper input[type=tel], .gform_wrapper input[type=number], .gform_wrapper input[type=password], .gform_wrapper textarea {
font-size: 14px !important;
}
$container.infinitescroll({
navSelector : '.nav-previous', // selector for the paged navigation
nextSelector : '.nav-previous a', // selector for the NEXT link (to page 2)
itemSelector : '.item', // selector for all items you'll retrieve
loading: {
finishedMsg: 'No more pages to load.',
img: 'http://i.imgur.com/qkKy8.gif'
}
},
// call Isotope as a callback
<center>
<table style="font-family: Helvetica; table-layout: fixed; max-width: 100% !important; width: 100% !important; min-width: 100% !important;" border="0" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td id="bodyCell" align="center" valign="top">
<table border="0" width="700" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tbody>
<tr>
<td align="center" valign="top" height="50">
<table style="color: #ffffff;" border="0" width="700" cellspacing="0" cellpadding="0" bgcolor="#c61d23">
@johnbuck
johnbuck / example-markup-output.php
Last active September 8, 2015 18:55
DRY output markup for modular use
prefix_output_example_markup() {
echo prefix_get_example_markup_html();
}
prefix_get_example_markup_html() {
$output = '<div>Here\'s some example markup</div>';
$output = '<div>Here\'s some more example markup </div>'
return $output;
}
Hi,
You're now being promoted by a local business on their official recommend business list.  <span style="text-decoration: underline;">If you're a Visiting Media member we've already synced your media &amp; content to this PartnerList™! </span>  Now you can easily manage what customers see as this business promotes you!
If you're not a Visiting Media member consider giving it a try!  <strong>Join Visiting Media as a basic+plus member free for 6 months!</strong>  Search for your business on this PartnerList™ and click 'claim this profile'.  Use discount code 'PARTNER'.  This offer is only available to businesses on a PartnerList™.
&nbsp;
<p style="text-align: left;"><strong>Watch this short video to learn more about the PartnerList™ tool!</strong></p>
<p style="text-align: left;">Can't see this video... <a href="http://visitingmedia.com/member-support/#partnerlist" target="_blank">click here to find it!</a></p>
<a href="http://visitingmedia.com/member-support/#partnerlist" target="_blank"><img src="http://
Hi!
One of our members just included your business on a Visiting Media map titled <strong>%collection_title%.  </strong>Find your business on this map here:  <strong>%collection_url%</strong>
<strong><span style="text-decoration: underline;">If you're a Visiting Media member we've already synced your profile content to this map!  You don't have to do anything!</span></strong>  If you're not a Visiting Media member please find your business on this map and click 'claim this profile'.
<a title="Contact Us" href="http://www.visitingmedia.com/contact-us/" target="_blank">Contact us</a> with any questions or to learn more.
&nbsp;