This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$pages = array( | |
$page_onair => array( | |
'page_id' => -1, | |
'slug' => 'radio-shows', | |
'author_id' => 1, | |
'title' => 'On Air Shows', | |
'tpl' => 'template-onair.php', | |
), | |
$page_weather => array( | |
'page_id' => -1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var example = "I am a string"; | |
// lowercase "i am a string" | |
example = example | |
.replace(/([A-Z])/g, function($1) { return $1.toLowerCase(); }); | |
// dashcase "i-am-a-string" | |
example = example | |
.replace(/\s+/g, "-") | |
.replace(/([A-Z])/g, function($1) { return $1.toLowerCase(); }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('genesis_post_title', 'genesis_do_post_title'); | |
function genesis_do_post_title() { | |
if ( is_singular() ) { | |
$title = sprintf( | |
'<h1 class="entry-title">%s</h1>', | |
apply_filters( 'genesis_post_title_text', get_the_title() ) | |
); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Simple HTML5 Skeleton Template</title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="style.css"> | |
<link rel="stylesheet" media="print" href="print.css"> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
export default class exampleClass extends Component { | |
addClassOnClick() { | |
let elementToAddClass = document.getElementById("exampleID"); | |
if (elementToAddClass) { | |
elementToAddClass.classList.toggle("exampleClass"); | |
} else { | |
console.log("No element found"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Example Plugin by Lucas Grey | |
* Description: Example plugin. | |
* Author: Lucas Grey | |
* Version: 1.0.0 | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php global $woocommerce; ?> | |
<a class="your-class-name" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('Cart View', 'woothemes'); ?>"> | |
<?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> - | |
<?php echo $woocommerce->cart->get_cart_total(); ?> | |
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove filtering on product page | |
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); | |
// Remove result count | |
remove_action( 'woocommerce_before_shop_loop' , 'woocommerce_result_count', 20 ); | |
// Remove product image zoom | |
remove_theme_support( 'wc-product-gallery-zoom' ); | |
// Remove sale badge from product cards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php global $current_user; wp_get_current_user(); ?> | |
<?php if ( is_user_logged_in() ) { | |
echo 'Username: ' . $current_user->user_login . "\n"; echo 'User display name: ' . $current_user->display_name . "\n"; } | |
else { wp_loginout(); } ?> |
NewerOlder