Skip to content

Instantly share code, notes, and snippets.

@angeliquejw
angeliquejw / thousandsSep.js
Last active April 9, 2016 15:35
Add a thousands separator in Highcharts
Highcharts.setOptions({
lang: {
thousandsSep: ','
}
});
@angeliquejw
angeliquejw / dummy-test-content.html
Last active March 2, 2016 16:18
Useful dummy content for testing out styling of HTML elements
<h1>CSS Basic Elements</h1>
<p>The purpose of this HTML is to help determine what default settings are with CSS and to make sure that all possible HTML Elements are included in this HTML so as to not miss any possible Elements when designing a site.</p>
<hr />
<h1>Line length</h1>
<p>abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz</p>
<h1>Headings</h1>
<h2>Heading 2</h2>
<p>And then some paragraph text to follow. The purpose of this HTML is to help determine what default settings are with CSS and to make sure that all possible HTML Elements are included in this HTML so as to not miss any possible Elements when designing a site.</p>
<iframe src="" frameborder="0" height="" width="100%"></iframe>
<div style="display:none!;font-size: 0px!important;max-height:0px!important;overflow:hidden!important;mso-hide:all!important;"></div>
@angeliquejw
angeliquejw / header.php
Created December 21, 2013 05:25
basic PHP include of meta description and page title
-- in header.php/html --
<meta name="description" content="<?php echo $pageDesc; ?>" />
<title><?php echo $pageTitle; ?> | Site Title</title>
-- @ top of index.php or other pages --
<?php
$pageDesc = "Description goes here";
$pageTitle = "Page Title goes here";
include("header.html");
?>
#lives {
color:black;
content:'matter';
}
@angeliquejw
angeliquejw / gist:7034866
Created October 18, 2013 00:56 — forked from sareiodata/gist:4307554
WP menus that switch based on if user is logged in or not
/**
* Register menus in functions.php
*/
register_nav_menus( array(
'logged-in' => __( 'Logged-in Menu Area', 'yourtheme' ),
'visitor' => __( 'Visitor Menu Area', 'yourtheme' ),
));
@angeliquejw
angeliquejw / wp_trim_cfield.php
Created August 20, 2013 20:20
Trim custom field in WordPress
<?php
$trim_length = 25; //desired length of text to display
$value_more = '(&hellip;)'; // what to add at the end of the trimmed text
$custom_field = 'my-custom-field-name';
$value = get_post_meta($post->ID, $custom_field, true);
if ($value) {
echo wp_trim_words( $value, $trim_length, $value_more);
}
?>
@angeliquejw
angeliquejw / WPbodyclass_pageslug.php
Created July 26, 2013 14:50
Add page slugs to the WordPress BODY class.
<?php
add_filter( 'body_class', 'add_slug_body_class' );
function add_slug_body_class( $classes ) {
global $post;
if ( isset( $post ) ) {
$classes[] = $post->post_type . '-' . $post->post_name;
}
return $classes;
}
?>