Skip to content

Instantly share code, notes, and snippets.

<?php $program = get_sub_field('program_selection'); ?>
<?php if( $program == 'intensity' ){ ?>
<?php } else if( $program == 'crossfit' ){ ?>
<?php } else if( $program == 'personal' ){ ?>
<?php } else if( $program == 'allprograms' ){ ?>
@eyecandy91
eyecandy91 / Paid Membership Pro Plugin
Created August 10, 2016 08:54 — forked from emiliano1991/Paid Membership Pro Plugin
Remove or edit "now." “The price for membership is $0.00 now.” for Membership Levels
function my1_pmpro_level_cost_text($text, $level) {
// is livel is free do nothing
if (pmpro_isLevelFree($level)) {
return "";
// else is different to free do this
} else {
//the full string is : The price for membership is $0.00 now.
$restituisci = str_replace("now.","",$text); // in this case you can remove "now." in the full string
return $restituisci;
@eyecandy91
eyecandy91 / gist:f1651934b5debfd0288e9dc79c3c31f2
Created August 15, 2016 01:51 — forked from strangerstudios/gist:4027538
Hide the confirm email and confirm password fields from the Paid Memberships Pro checkout page.
/*
Don't show confirm password or email fields on the checkout page.
Add this code to your active theme's functions.php or a custom plugin.
*/
add_filter("pmpro_checkout_confirm_password", "__return_false");
add_filter("pmpro_checkout_confirm_email", "__return_false");
@eyecandy91
eyecandy91 / dabblet.css
Created February 24, 2017 08:12 — forked from chriscoyier/dabblet.css
Click open/close Dropdown in pure CSS
/* Click open/close Dropdown in pure CSS */
/* Disclaimer: Not the most semantic
thing in the universe. */
/* Forked from original idea
http://jsfiddle.net/paullferguson/Sv54G/3/ */
.tabs {
position: relative;
@eyecandy91
eyecandy91 / water_ripple_canvas.js
Created September 9, 2017 10:17 — forked from StuPig/water_ripple_canvas.js
Use JavaScript and canvas to create water ripple effect
/*
* Water Canvas by Almer Thie (http://code.almeros.com).
* Description: A realtime water ripple effect on an HTML5 canvas.
* Copyright 2010 Almer Thie. All rights reserved.
*
* Example: http://code.almeros.com/code-examples/water-effect-canvas/
* Tutorial: http://code.almeros.com/water-ripple-canvas-and-javascript
*/
@eyecandy91
eyecandy91 / cacert.pem
Created February 23, 2018 03:11 — forked from HTMLGuyLLC/cacert.pem
cacert.pem to create a secure connection to APIs
##
## ca-bundle.crt -- Bundle of CA Root Certificates
##
## Certificate data from Mozilla as of: Sat Dec 29 20:03:40 2012
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
## file (certdata.txt). This file can be found in the mozilla source tree:
## http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1
##
@eyecandy91
eyecandy91 / Wordpress: Do if the_content is not empty
Created March 31, 2019 11:27 — forked from bhongy/Wordpress: Do if the_content is not empty
Wordpress: Check if the_content is empty / do something only when the_content is empty
<?php
$thecontent = get_the_content();
if(!empty($thecontent)) { ?>
// do or output something
<?php } ?> // break php tag for HTML block
@eyecandy91
eyecandy91 / toggle-menu.js
Created April 24, 2019 12:38 — forked from Bradcomp/toggle-menu.js
Toggles the .is-active class for a hamburger menu
(function() {
var burger = document.querySelector('.nav-toggle');
var menu = document.querySelector('.nav-menu');
burger.addEventListener('click', function() {
burger.classList.toggle('is-active');
menu.classList.toggle('is-active');
});
})();
@eyecandy91
eyecandy91 / gist:452beeae8f6c3e704de6c13b0ad0514d
Created April 25, 2019 03:54 — forked from govindak/gist:7435288
Get the featured image by page ID in WordPress
<?php
//page id
$page_id = "5"; //example
if (has_post_thumbnail($page_id) ):
$image = wp_get_attachment_image_src( get_post_thumbnail_id($page_id), 'single-post-thumbnail' );
endif;
$image_URI = $image[0];
@eyecandy91
eyecandy91 / loop-custom.php
Created June 20, 2019 07:42 — forked from kevinwhoffman/loop-custom.php
WordPress - Custom Post Type Loop
<?php
$loop = new WP_Query( array(
'post_type' => 'Property',
'posts_per_page' => -1
)
);
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>