Skip to content

Instantly share code, notes, and snippets.

@angeliquejw
angeliquejw / SassMeister-input.scss
Created May 22, 2015 03:54
Generated by SassMeister.com.
// ----
// libsass (v3.2.4)
// ----
$black : #171E22;
$lime: #92bd0a;
$monofont : bpmonoregular, monospace;
.siteHeader {
background:$black;
<?php
$meta = get_cfc_meta( 'metaname' );
$metadetails .= '<ul>';
if( !empty( $meta ) ){
foreach( $meta as $key => $value ){
$metaapp = get_cfc_field( 'metaname','doclink', false, $key );
$metadetails .= '<li><a class ="btn" href="' . $metaapp . '">Apply Now</a></span></li>';
}
}
$metadetails .= '</ul>';
@angeliquejw
angeliquejw / footnote.html
Created February 25, 2014 22:48
PROJECT // Metacookbook // Footnote template
IN THE MAIN ARTICLE, YOU WRITE
textextblahblah<sup><a href="#fn1" id="fn1-return">1</a></sup>
AFTER THE ARTICLE, YOU WRITE
<hr />
<sup id="fn1">1</sup> Put your footnote here. <a href="#fn1-return">&#10149;</a>
@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");
?>
@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;
}
?>
@angeliquejw
angeliquejw / WPbodyclass_browserID.php
Last active December 20, 2015 06:58
Add browser classes to the BODY of a WordPress site. Not necessary if you're already using Modernizr or another solution.
<?php
add_filter('body_class','browser_body_class');
function browser_body_class($classes) {
global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
if($is_lynx) $classes[] = 'lynx';
elseif($is_gecko) $classes[] = 'gecko';
elseif($is_opera) $classes[] = 'opera';
elseif($is_NS4) $classes[] = 'ns4';
elseif($is_safari) $classes[] = 'safari';
elseif($is_chrome) $classes[] = 'chrome';
@angeliquejw
angeliquejw / httpd-vhosts
Created July 24, 2013 15:00
1. Create new directory and index.html 2. Update windows host file @ C:\windows\system32\drivers\etc\hosts (127.0.0.1 MySite.Dev) 3. Update httpd-vhosts file (see below) 4. Copy WordPress files to directory from step 1 5. Go to phpmyadmin, create user and database 6. Browse to site and let WordPress configure everything
<VirtualHost MyLocalSite.dev:80>
ServerAdmin postmaster @ MyLocalSite.dev
DocumentRoot "C:/xampp/htdocs/MyLocalSite.dev"
ServerName MyLocalSite.dev
ServerAlias www.MyLocalSite.dev
ErrorLog "logs/MyLocalSite.dev-error.log"
CustomLog "logs/MyLocalSite.dev-access.log" combined
</VirtualHost>
@angeliquejw
angeliquejw / countries.txt
Last active December 19, 2015 07:39
shortcode list of countries & states for Contact Form 7
[select your-country include_blank "Afghanistan" "Albania" "Algeria" "American Samoa" "Andorra" "Angola" "Anguilla" "Antarctica" "Antigua and Barbuda" "Argentina" "Armenia" "Arctic Ocean" "Aruba" "Ashmore and Cartier Islands" "Atlantic Ocean" "Australia" "Austria" "Azerbaijan" "Bahamas" "Bahrain" "Baker Island" "Bangladesh" "Barbados" "Bassas da India" "Belarus" "Belgium" "Belize" "Benin" "Bermuda" "Bhutan" "Bolivia" "Bosnia and Herzegovina" "Botswana" "Bouvet Island" "Brazil" "British Virgin Islands" "Brunei" "Bulgaria" "Burkina Faso" "Burundi" "Cambodia" "Cameroon" "Canada" "Cape Verde" "Cayman Islands" "Central African Republic" "Chad" "Chile" "China" "Christmas Island" "Clipperton Island" "Cocos Islands" "Colombia" "Comoros" "Cook Islands" "Coral Sea Islands" "Costa Rica" "Cote d'Ivoire" "Croatia" "Cuba" "Cyprus" "Czech Republic" "Denmark" "Democratic Republic of the Congo" "Djibouti" "Dominica" "Dominican Republic" "East Timor" "Ecuador" "Egypt" "El Salvador" "Equatorial Guinea" "Eritrea" "Estonia" "Ethi