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 | |
// Register the post type and taxonomy | |
function init_product_cpt() { | |
register_post_type( 'product', array( | |
'public' => true, | |
'label' => __( 'Products', 'my-plugin' ) | |
) ); | |
register_taxonomy( 'color', 'product', array( |
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 | |
/** | |
* Name: Attachments Metabox Uploader | |
* Author: Jared Williams - http://new2wp.com | |
* Description: This is for adding a custom metabox to post types which enables you to add/remove | |
* post attachments that you can upload and enter the meta information for right on the edit page. | |
* Version: 0.1.0 | |
* | |
* Notes: In order to add this to a post type you need to find the word 'product' and replace it with * whatever the post type is you want to use it on. | |
*/ |
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 | |
/* | |
define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', home_url() . '/' ) ); | |
define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', site_url() . '/' ) ); | |
define('ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); | |
define('PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) ); | |
*/ | |
define( 'WPH_FUNC_PATH', get_template_directory() . '/functions' ); | |
define( 'WPH_FUNC_URL', get_bloginfo('template_directory' ).'/functions' ); |
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 | |
/** | |
* Name: Attachments Metabox Uploader | |
* Author: Jared Williams - http://new2wp.com | |
* Description: This is for adding a custom metabox to post types which enables you to add/remove | |
* post attachments that you can upload and enter the meta information for right on the edit page. | |
* Version: 0.1.0 | |
* | |
* @usage: In order to add this to a post type you need to find the word 'product' and replace | |
* it with whatever the post type is you want to use it on. |
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 | |
/** | |
* Custom Metabox for uploading post image attachments | |
* Created by Jared Williams - http://new2wp.com | |
*/ | |
add_action( 'admin_init', 'add_attachment' ); | |
add_action( 'save_post', 'update_attachment' ); | |
add_action( 'post_edit_form_tag', 'form_multipart_encoding' ); | |
//add_action( 'manage_posts_custom_column', 'product_custom_columns' ); | |
//add_filter( 'manage_edit-product_columns', 'product_edit_columns' ); |
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 $epaged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
$temp = $wp_query; | |
$wp_query = null; | |
?> | |
<?php $wp_query = new WP_Query('category_name=portfolio&tag=web&showposts=5&paged=' . $epaged);?> | |
<?php if ($wp_query->have_posts()) : ?> | |
<section class="itemBlocks"> | |
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?> | |
<article class="iBlock"> | |
<time datetime="<?php the_time('Y-m-d') ?>" class="fs-14" pubdate><?php the_time('F jS, Y') ?></time> |
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: Taxonomy Map | |
Plugin URI: http://wordpress.mfields.org/plugins/taxonomy-images/ | |
Description: Use a hierarchical taxonomy system to display Goole map. | |
Version: 0.1 | |
Author: Michael Fields | |
Author URI: http://wordpress.mfields.org/ | |
License: GPLv2 |
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 | |
$weather_loc = 10001; | |
function getWeather( $weather_loc ) { | |
// weather data url, location based | |
$requestAddress = 'http://www.google.com/ig/api?weather=$weather_loc&hl=en'; | |
// Parse XML | |
$xml_str = file_get_contents($requestAddress,0); |