Skip to content

Instantly share code, notes, and snippets.

@ameeker
ameeker / gist:bd68fdc0f26b745f14af499667f3bb06
Last active February 14, 2019 15:43
Alert Boxes, OptinMonster
<div class="alert alert-warning">YOUR CONTENT HERE</div>
.alert {
padding: 20px;
margin: 30px 0;
border: 1px solid transparent;
border-radius: 3px;
font-size: 16px;
line-height: 1.6;
@ameeker
ameeker / gist:2cf4690deb5521bded0b92feba48cab9
Created January 15, 2019 15:45
OptinMonster, Disable Fullscreen Background Clicks
We don't have a method to do this in the builder, but it can be done with some custom JS using our API. Unfortunately, we don't provide further support for this method, so you may need to have your developer take a look to ensure it works as expected for your website.
The way to do this is simple:
document.addEventListener('om.Types.init', event => {
event.detail.Types.Type.bgClose = false;
});
If a customer wants to do this on a case-by-case basis, they can adjust to check the campaign id specifically:
document.addEventListener('om.Types.init', event => {
@ameeker
ameeker / gist:501107545c0678c3d00d07727af6fd49
Created October 6, 2017 15:12
OptinMonster: Testing with and without optin variations in VWO
if (window.timerX) clearInterval(window.timerX);
window.timerX = setInterval(function()
{
if (vwo_$('#om-YOUR-OPTIN-SLUG').length)
{
vwo_$('#om-YOUR-OPTIN-SLUG').remove(); // script S1 here.
clearInterval(window.timerX);
}
}, 100);
<?php if (has_term (‘gardening’, ‘topics’)) : ?>
<p>This is the text to describe gardening</p>
<?php elseif (has_term(‘cooking,’ topics')) : ?>
<p>This is the text to describe cooking</p>
<?php else : ?>
<p>This is some generic text to describe all other taxonomy term pages, I could be left blank</p>
<?php endif; ?>
The WordPress Community Intro
Installing WordPress
House illustration
Host = Land
Domain = address
Email = mailbox
WordPress = house
Themes = interior design
Plugins = the FROG or Pool
WordPress.com vs WordPress.org
WORDPRESS 201 OUTLINE
TEMPLATE HIERARCHY
• https://developer.wordpress.org/themes/basics/template-hierarchy/
THE LOOP
• https://codex.wordpress.org/The_Loop
• Resetting the Loop
• Multiple Loops on one page
HOOKS, ACTIONS, FILTERS
@ameeker
ameeker / gist:746dbe2c46cd4d3978c3
Created June 15, 2015 20:17
Add WooCommerce Order ID column to Gravity Forms export
add_filter( 'gform_export_fields', 'add_fields', 10, 1 );
function add_fields( $form ) {
array_push( $form['fields'], array( 'id' => 'orderid', 'label' => __( 'Order ID', 'gravityforms' ) ) );
return $form;
}
add_filter( 'gform_export_field_value', 'set_export_values', 10, 4 );
function set_export_values( $value, $form_id, $field_id, $lead ) {
switch( $field_id ) {
@ameeker
ameeker / gist:07236b753e9c3ea446ee
Created February 10, 2015 15:56
Display stock availability in Woo
// WooCommerce Display Stock Availability
add_action( 'woocommerce_single_product_summary', 'wcs_stock_text_shop_page', 25 );
//create our function
function wcs_stock_text_shop_page() {
//returns an array with 2 items availability and class for CSS
global $product;
$availability = $product->get_availability();
//check if availability in the array = string 'Out of Stock'
//if so display on page.//if you want to display the 'in stock' messages as well just leave out this, == 'Out of stock'
if ( $availability['availability']) {
@ameeker
ameeker / gist:e94a5df3058675c67a9e
Created December 1, 2014 02:20
Taxonomy Images, Displays correct images but no term names
echo '<h5>Tagged Features</h5><ul class="tagged-features">';
$terms = apply_filters( 'taxonomy-images-list-the-terms', '', array(
'taxonomy' => 'features',
'image_size' => 'detail',
) );
foreach( (array) $terms as $term){
echo $term;
};
@ameeker
ameeker / gist:48a017c5c0e899fafb9a
Created November 4, 2014 21:42
Reordering, and Adding new networks to Simple Social Icons, including Trip Advisor
//* Add Trip Advisor Icon to Simple Social Icons
add_filter( 'simple_social_default_profiles', 'custom_simple_social_default_profiles' );
function custom_simple_social_default_profiles() {
$glyphs = array(
'tripadvisor' => '<img src="http://bb.angiemeekerdesigns.com/wp-content/uploads/2014/11/tripadvisor-xxl.png" alt="Trip Advisor">',
'email' => '&#xe80b;',
'facebook' => '&#xe802;',
'flickr' => '&#xe80a;',
'gplus' => '&#xe801;',
'instagram' => '&#xe809;',