Instantly share code, notes, and snippets.

View WP Course App CSS Options
/* MENU CSS
----------------------------------------*/
/*change color of menu background*/
.side-nav {
background-color: #121212;
}
/*change color of close button*/
.side-nav .closebtn {
View gist:6405261e4b25cbce982eaea34deb9ea2
// JERRICK'S STATUS JS
jQuery(function(){
// get current hour
var now = new Date(Date.now());
var hour = now.getHours();
var min = now.getMinutes()
var statustitle = jQuery('#jh_status').attr('title');
if (hour >= 0 & hour <=7 ) {
jQuery('#jh_status').attr('src', 'https://d33t7gcdmhxpn0.cloudfront.net/getting-out-of-bed.png'); jQuery('#status-text h2').text("Sleeping Zzzz...");
} else if (hour >= 8 & hour <= 9 ) { jQuery('#jh_status').attr('src', 'https://d33t7gcdmhxpn0.cloudfront.net/getting-out-of-bed.png'); jQuery('#status-text h2').text("Morning!!");
View WP Course App Basic Custom CSS
/* MENU CSS
----------------------------------------*/
/*change color of menu background*/
nav#menu-wpca {
background: #0049ff;
}
/*change color of module title in advanced mode*/
h2.module-title {
View gist:85c258396491389fbfa836b4cbbb4bf7
function wpca_sales_feed_save_settings(){
$wpca_sales_feed_save = array(
'wpca_show_for_logged_users',
'wpca_feed_begin',
'wpca_feed_begin',
'wpca_feed_show_for',
'wpca_cards_per_user',
'sales_feed_in_animation',
'sales_feed_out_animation',
View gist:004045ff6c7ac9a1dca97bd014e624d4
<?php
$animation = array(
'none' => esc_attr__( 'None', 'wpca-sales-feed' ),
'bounce' => esc_attr__( 'bounce', 'wpca-sales-feed' ),
'flash' => esc_attr__( 'flash', 'wpca-sales-feed' ),
'pulse' => esc_attr__( 'pulse', 'wpca-sales-feed' ),
'rubberBand' => esc_attr__( 'rubberBand', 'wpca-sales-feed' ),
'shake' => esc_attr__( 'shake', 'wpca-sales-feed' ),
'headShake' => esc_attr__( 'headShake', 'wpca-sales-feed' ),
'swing' => esc_attr__( 'swing', 'wpca-sales-feed' ),
View gist:a54a352be47b54a87d9a412de6112fa7
// BLOCK WORDPRESS DASHBOARD
function block_dashboard() {
$file = basename($_SERVER['PHP_SELF']);
if (is_user_logged_in() && is_admin() && !current_user_can('edit_posts') && $file != 'admin-ajax.php'){
wp_redirect( home_url('/account') );
exit();
}
}
View gist:5d1feecb73b8179213b36db38eb7c3f9
add_action( 'wp_enqueue_scripts', 'monica_register_js' );
function monica_register_js() {
wp_register_script( 'monica-theme-js', get_template_directory_uri() . '/js/monica.js', array( 'jquery' ), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'monica_localize' );
View gist:8578dcd41edd9981795b19704ad485ff
function custom_text_per_shipping_class() {
global $product;
$product = wc_get_product();
$shipping_class = $product->get_shipping_class();
if ($shipping_class == 'a'){
echo "a";
} elseif ($shipping_class == 'b') {
echo "b";
} else {
View My Domain to Affiliate Link Redirect with WordPress
View HTML To Shortcode WordPress
function register_my_shortcode() {
ob_start(); ?>
<div class="my-shortcode">
<h1>Hi, I am the shortcode.</h1><hr />
<p>This is a screenshot of how I was created!</p>
<img src="https://d153h1xtzgec02.cloudfront.net/shortcode-function-blog-post.png" alt="Function Screen Shot">
<p>I was created by pasting &#x5b;shortcode_name] on this post!</p>
</div>
<?php
return ob_get_clean();