Skip to content

Instantly share code, notes, and snippets.

View rachelmccollin's full-sized avatar

Rachel McCollin rachelmccollin

View GitHub Profile
// set up labels
$labels = array(
'name' => 'Product Categories',
'singular_name' => 'Product Category',
'search_items' => 'Search Product Categories',
'all_items' => 'All Product Categories',
'edit_item' => 'Edit Product Category',
'update_item' => 'Update Product Category',
'add_new_item' => 'Add New Product Category',
'new_item_name' => 'New Product Category',
<?php
/*Plugin Name: Create Product Category Taxonomy
Description: This plugin registers the 'product category' taxonomy and applies it to the 'product' post type.
Version: 1.0
License: GPLv2
*/
// register two taxonomies to go with the post type
function wpmudev_register_taxonomy() {
// set up labels
while ( have_posts() ) : the_post();
the_meta();
$price = get_post_meta( get_the_ID(), 'Price', true );
if( ! empty( $price ) ) {
echo '<p>Price: $' . $price . '</p>';
}
function rmcc_register_taxonomy() {
$labels = array(
'name' => __( 'Weebles' ),
'singular_name' => __( 'Weeble' ),
'search_items' => __( 'Search Weebles' ),
'all_items' => __( 'All Weebles' ),
'edit_item' => __( 'Edit Weebles' ),
'update_item' => __( 'Update Weebles' ),
'add_new_item' => __( 'Add New Weebles' ),
@rachelmccollin
rachelmccollin / Twenty fifteen child theme
Last active August 29, 2015 14:17
WPMUDEV Creating Menu Icons
<?php
/*
Theme Name: WPMU DEV Custom Navigation Menu Icons
Theme URI: http://rachelmccollin.co.uk/wpmudev-custom-menu-icons
Description: Theme to support WPMU DEV post on custom menu items
Author: Rachel McCollin
Author URI: http://rachelmccollin.co.uk/
Template: twentyfifteen
Version: 1.0
*/
@rachelmccollin
rachelmccollin / Activate Font Awesome
Last active February 1, 2018 22:45
WPMUDEV Creating Menu Icons
<?php
function wmpudev_enqueue_icon_stylesheet() {
wp_register_style( 'fontawesome', 'http:////maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css' );
wp_enqueue_style( 'fontawesome');
}
add_action( 'wp_enqueue_scripts', 'wmpudev_enqueue_icon_stylesheet' );
?>
@rachelmccollin
rachelmccollin / CSS for Home menu item
Created March 25, 2015 11:31
WPMUDEV Creating Menu Icons
fa fa-lg fa-home
@rachelmccollin
rachelmccollin / Navigation Menu width styling
Created March 25, 2015 11:44
WPMUDEV Creating Menu Icons
.main-navigation ul li {
width: 100%;
}