Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /** Start the engine */
- require_once( get_template_directory() . '/lib/init.php' );
- require_once( get_stylesheet_directory() . '/lib/style.php' );
- /** Child theme (do not remove) */
- define( 'CHILD_THEME_NAME', 'Backcountry Child Theme' );
- define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/backcountry' );
- add_theme_support('post-templates');
- $content_width = apply_filters( 'content_width', 470, 400, 910 );
- ///limit excerpt
- function limit_words($string, $word_limit) {
- // creates an array of words from $string (this will be our excerpt)
- // explode divides the excerpt up by using a space character
- $words = explode(' ', $string);
- // this next bit chops the $words array and sticks it back together
- // starting at the first word '0' and ending at the $word_limit
- // the $word_limit which is passed in the function will be the number
- // of words we want to use
- // implode glues the chopped up array back together using a space character
- return implode(' ', array_slice($words, 0, $word_limit));
- }
- /** Add new image sizes */
- add_image_size( 'home-bottom', 170, 90, TRUE );
- add_image_size( 'home-middle', 265, 150, TRUE );
- add_image_size( 'home-mini', 50, 50, TRUE );
- /** Add support for custom background */
- add_custom_background();
- /** Add support for custom header */
- add_theme_support( 'genesis-custom-header', array( 'width' => 960, 'height' => 120 ) );
- /** Reposition the primary navigation */
- remove_action( 'genesis_after_header', 'genesis_do_nav' );
- add_action( 'genesis_before_header', 'genesis_do_nav' );
- /** Add description to secondary navigation */
- add_filter( 'walker_nav_menu_start_el', 'add_description', 10, 4 );
- function add_description( $item_output, $item, $depth, $args ) {
- $args = (array) $args;
- if ( $args['theme_location'] != 'primary' ) {
- return preg_replace( '/(<a.*?>[^<]*?)</', '$1' . "<div class=\"menu-description\">{$item->post_content}</div><", $item_output );
- }
- else {
- return $item_output;
- }
- }
- /** Add home top section to homepage */
- add_action( 'genesis_before_content_sidebar_wrap', 'backcountry_home_top' );
- function backcountry_home_top() {
- if ( is_front_page() && is_active_sidebar( 'home-top' ) ) {
- echo '<div id="home-top">';
- dynamic_sidebar( 'home-top' );
- echo '</div><!-- end #home-top -->';
- }
- }
- /** Customize the post info function */
- add_filter( 'genesis_post_info', 'backcountry_post_info_filter' );
- function backcountry_post_info_filter( $post_info ) {
- return '[post_date] by [post_author_posts_link] · [post_comments] [post_edit]';
- }
- /** Customize the post meta function */
- add_filter( 'genesis_post_meta', 'backcountry_post_meta_filter' );
- function backcountry_post_meta_filter( $post_meta ) {
- return '[post_categories before="Filed Under: "] · [post_tags before="Tagged: "]';
- }
- /** Add after post ad section */
- add_action( 'genesis_after_post_content', 'backcountry_after_post_ad', 9 );
- function backcountry_after_post_ad() {
- if ( is_single() && is_active_sidebar( 'after-post-ad' ) ) {
- echo '<div class="after-post-ad">';
- dynamic_sidebar( 'after-post-ad' );
- echo '</div><!-- end .after-post-ad -->';
- }
- }
- /** Add support for 3-column footer widgets */
- add_theme_support( 'genesis-footer-widgets', 4 );
- /** Register widget areas */
- genesis_register_sidebar( array(
- 'id' => 'home-top',
- 'name' => __( 'Home Top', 'backcountry' ),
- 'description' => __( 'This is the home top section.', 'backcountry' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-left',
- 'name' => __( 'Home Left', 'backcountry' ),
- 'description' => __( 'This is the home left section.', 'backcountry' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-right',
- 'name' => __( 'Home Right', 'backcountry' ),
- 'description' => __( 'This is the home right section.', 'backcountry' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'home-bottom',
- 'name' => __( 'Home Bottom', 'backcountry' ),
- 'description' => __( 'This is the home bottom section.', 'backcountry' ),
- ) );
- genesis_register_sidebar( array(
- 'id' => 'after-post-ad',
- 'name' => __( 'After Post Ad', 'magazine' ),
- 'description' => __( 'This is the after post ad section.', 'backcountry' ),
- ) );
- // Allows Shortcodes in text widgets
- add_filter('widget_text', 'do_shortcode');
- // Modify credits section
- add_filter('genesis_footer_creds_text', 'custom_footer_creds_text');
- function custom_footer_creds_text($creds) {
- $creds = '[footer_copyright]' . get_bloginfo('name') . ' • Site by <a href="http://www.trailsherpa.com">Trail Sherpa LLC</a> • <a href="http://www.trailsherpa.com/about-us/">About Us</a> <br> <a href="http://www.trailsherpa.com/wp-login.php">Team Trail Sherpa Login</a> • <a href="http://www.trailsherpa.com//website-use-and-privacy-policy/">Privacy</a> • <a href="http://www.trailsherpa.com/report-a-bug/">Report a Bug</a><br>
- Trail Sherpa is a Proud Member of <br><a href="http://onepercentfortheplanet.org/" target="_blank"><img src="/wp-content/uploads/2011/09/1percent_logo.gif"></a> ';
- return $creds;
- }
- //add CPTs to author page
- function custom_post_author_archive($query) {
- if ($query->is_author)
- $query->set( 'post_type', array('trails', 'recipes', 'reviews', 'post') );
- remove_action( 'pre_get_posts', 'custom_post_author_archive' );
- }
- add_action('pre_get_posts', 'custom_post_author_archive');
- //altering the author box
- add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
- add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );
- function my_show_extra_profile_fields( $user ) { ?>
- <h3>Extra profile information</h3>
- <table class="form-table">
- <tr>
- <th><label for="twitter">Twitter Username</label></th>
- <td>
- <input type="text" name="twitter" id="twitter" value="<?php echo esc_attr( get_the_author_meta( 'twitter', $user->ID ) ); ?>" class="regular-text" /><br />
- <span class="description">Please enter your Twitter username.</span>
- </td>
- </tr>
- <tr>
- <th><label for="facebook">Facebook Profile Name</label></th>
- <td>
- <input type="text" name="facebook" id="facebook" value="<?php echo esc_attr( get_the_author_meta( 'facebook', $user->ID ) ); ?>" class="regular-text" /><br />
- <span class="description">Please enter JUST your facebook profile name (i.e <b>profile_name</b>.</span>
- </td>
- </tr>
- <tr>
- <th><label for="facebook">Facebook Page Name or ID</label></th>
- <td>
- <input type="text" name="facebookpg" id="facebookpg" value="<?php echo esc_attr( get_the_author_meta( 'facebookpg', $user->ID ) ); ?>" class="regular-text" /><br />
- <span class="description">Please enter JUST your facebook fan page name/id (i.e <b>page_name</b>.</span>
- </td>
- </tr>
- <tr>
- <th><label for="google">Google+ ID</label></th>
- <td>
- <input type="text" name="google" id="google" value="<?php echo esc_attr( get_the_author_meta( 'google', $user->ID ) ); ?>" class="regular-text" /><br />
- <span class="description">Please enter JUST your Google+ ID (i.e <b>123456789</b>.</span>
- </td>
- </tr>
- <tr>
- <th><label for="flickr">Flickr Page ID</label></th>
- <td>
- <input type="text" name="flickr" id="flickr" value="<?php echo esc_attr( get_the_author_meta( 'flickr', $user->ID ) ); ?>" class="regular-text" /><br />
- <span class="description">Please enter JUST your Flickr Page ID name (i.e <b>id_name</b>.</span>
- </td>
- </tr>
- <tr>
- <th><label for="youtube">YouTube Channel Name</label></th>
- <td>
- <input type="text" name="youtube" id="youtube" value="<?php echo esc_attr( get_the_author_meta( 'youtube', $user->ID ) ); ?>" class="regular-text" /><br />
- <span class="description">Please enter JUST your YouTube Channel Name (i.e <i>channel_name</i>.</span>
- </td>
- </tr>
- </table>
- <?php }
- add_action( 'personal_options_update', 'my_save_extra_profile_fields' );
- add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );
- function my_save_extra_profile_fields( $user_id ) {
- if ( !current_user_can( 'edit_user', $user_id ) )
- return false;
- /* Copy and paste this line for additional fields. Make sure to change 'twitter' to the field ID. */
- update_usermeta( $user_id, 'twitter', $_POST['twitter'] );
- update_usermeta( $user_id, 'facebook', $_POST['facebook'] );
- update_usermeta( $user_id, 'facebookpg', $_POST['facebookpg'] );
- update_usermeta( $user_id, 'google', $_POST['google'] );
- update_usermeta( $user_id, 'flickr', $_POST['flickr'] );
- update_usermeta( $user_id, 'linkedin', $_POST['linkedin'] );
- update_usermeta( $user_id, 'youtube', $_POST['youtube'] );
- update_usermeta( $user_id, 'email', $_POST['email'] );
- }
- function my_author_box() {
- ?>
- <div class="author-box">
- <?php echo get_avatar( get_the_author_meta( 'user_email' ), '70' ); ?>
- <strong><?php the_author_posts_link(); ?></strong>
- <p class="author-description author-bio">
- <?php the_author_meta( 'description' ); ?>
- </p><div class="sm-box2"><ul>
- <?php if ( get_the_author_meta( 'twitter' ) ) { ?>
- <li>
- <a href="http://twitter.com/<?php the_author_meta( 'twitter' ); ?>"target="_blank" title="Follow <?php the_author_meta( 'display_name' ); ?> on Twitter"><img src="http://www.trailsherpa.com/wp-content/uploads/2011/08/sm_icons_02.gif" height="35"/></a>
- </li>
- <?php } // End check for twitter ?>
- <?php if ( get_the_author_meta( 'facebook' ) ) { ?>
- <li>
- <a href="http://www.facebook.com/<?php the_author_meta( 'facebook' ); ?>" target="_blank" title="Follow <?php the_author_meta( 'display_name' ); ?> on Facebook"><img src="http://www.trailsherpa.com/wp-content/uploads/2011/08/sm_icons_01.gif" height="35"/></a>
- </li>
- <?php } // End check for fb ?>
- <?php if ( get_the_author_meta( 'facebookpg' ) ) { ?>
- <li>
- <a href="http://www.facebook.com/<?php the_author_meta( 'facebookpg' ); ?>" target="_blank" title="Become a Fan <?php the_author_meta( 'display_name' ); ?> on Facebook"><img src="http://www.trailsherpa.com/wp-content/uploads/2011/09/sm_icons_10.png" height="35"/></a>
- </li>
- <?php } // End check for fbpg ?>
- <?php if ( get_the_author_meta( 'google' ) ) { ?>
- <li>
- <a href="https://plus.google.com/<?php the_author_meta( 'google' ); ?>" target="_blank" title="Follow <?php the_author_meta( 'display_name' ); ?> on Google+"><img src="http://www.trailsherpa.com/wp-content/uploads/2011/08/sm_icons_05.png" height="35"/></a>
- </li>
- <?php } // End check for google ?>
- <?php if ( get_the_author_meta( 'flickr' ) ) { ?>
- <li>
- <a href="http://www.flickr.com/photos/<?php the_author_meta( 'flickr' ); ?>" target="_blank" title="Find <?php the_author_meta( 'display_name' ); ?> on flickr"><img src="http://www.trailsherpa.com/wp-content/uploads/2011/09/sm_icons_08.png" height="35"/></a>
- </li>
- <?php } // End check for flickr ?>
- <?php if ( get_the_author_meta( 'youtube' ) ) { ?>
- <li>
- <a href="http://www.youtube.com/user/<?php the_author_meta( 'youtube' ); ?>" target="_blank" title="Find <?php the_author_meta( 'display_name' ); ?> on youtube"><img src="http://www.trailsherpa.com/wp-content/uploads/2011/09/sm_icons_09.png" height="35"/></a>
- </li>
- <?php } // End check for youtube ?>
- <?php if ( get_the_author_meta( 'email' ) ) { ?>
- <li><a href="mailto:<?php the_author_meta( 'email' ); ?>" title="email"><img src="http://www.trailsherpa.com/wp-content/uploads/2011/09/sm_icons_06.png" height="35"/></a>
- </li>
- <?php } // End check for email ?>
- <?php if ( get_the_author_meta( 'url' ) ) { ?>
- <li><a href="<?php the_author_meta( 'url' ); ?>" title="website" target="_blank"><img src="http://www.trailsherpa.com/wp-content/uploads/2011/09/sm_icons_07.png" height="35"/></a>
- </li>
- <?php } // End check for website ?>
- </ul></div> </div><?php
- }
- remove_action('genesis_after_post', 'genesis_do_author_box_single');
- add_action('genesis_after_post_content', 'genesis_do_MYauthor_box_single');
- function genesis_do_MYauthor_box_single() {
- if(is_single()) {
- my_author_box();
- }}
- //Custom post types
- include_once('lib/post-type/post-types.php'); // post types class
- include_once('lib/post-type/register-posttypes.php'); // register post types
- // Include & setup custom metabox and fields
- $prefix = '_cmb_'; // start with an underscore to hide fields from custom fields list
- $meta_boxes = array();
- $meta_boxes[] = array(
- 'id' => 'trail_details',
- 'title' => 'Trail Details',
- 'pages' => array('trails'), // post type
- 'context' => 'normal',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'Trail Duration',
- 'desc' => 'Enter Trail Duration',
- 'id' => $prefix . 'trail_duration',
- 'type' => 'text_small'
- ),
- array(
- 'name' => 'City',
- 'desc' => 'Enter Trail City',
- 'id' => $prefix . 'trail_city',
- 'type' => 'text_small'
- ),
- array(
- 'name' => 'Difficulty',
- 'desc' => 'Enter Trail Difficulty',
- 'id' => $prefix . 'trail_difficulty',
- 'type' => 'text_small'
- ),
- array(
- 'name' => 'Time on Trail',
- 'desc' => 'Enter Time on Trail',
- 'id' => $prefix . 'trail_time',
- 'type' => 'text_small'
- ),
- array(
- 'name' => 'Distance',
- 'desc' => 'Enter Trail Distance',
- 'id' => $prefix . 'trail_distance',
- 'type' => 'text_small'
- ),
- array(
- 'name' => 'Elevation',
- 'desc' => 'Enter Trail Elevation',
- 'id' => $prefix . 'trail_elevation',
- 'type' => 'text_small'
- ),
- )
- );
- $meta_boxes[] = array(
- 'id' => 'trail_images',
- 'title' => 'Trail Images',
- 'pages' => array('trails'), // post type
- 'context' => 'normal',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'Flickr Gallery',
- 'desc' => 'Paste code from Flickr',
- 'id' => $prefix . 'trail_flickr',
- 'type' => 'wysiwyg'
- ),
- array(
- 'name' => 'Trail Images',
- 'desc' => 'Upload a file or enter an URL.',
- 'id' => $prefix . 'trail_images',
- 'type' => 'multiple_files'
- ),
- )
- );
- $meta_boxes[] = array(
- 'id' => 'trail_video',
- 'title' => 'Trail Video',
- 'pages' => array('trails'), // post type
- 'context' => 'normal',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'Trail Video',
- 'desc' => 'Paste Embed Video URL from YouTube: i.e. http://www.youtube.com/embed/4T4BsjIvgvU?rel=0&hd=1',
- 'id' => $prefix . 'trail_video',
- 'type' => 'text_medium'
- ),
- array(
- 'name' => 'Trail Video Description',
- 'desc' => 'Video Description',
- 'id' => $prefix . 'trail_video_description',
- 'type' => 'wysiwyg'
- ),
- )
- );
- $meta_boxes[] = array(
- 'id' => 'trail_notes',
- 'title' => 'Trail Notes',
- 'pages' => array('trails'), // post type
- 'context' => 'normal',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'Trail Notes',
- 'desc' => 'Enter Trail Notes',
- 'id' => $prefix . 'trail_notes',
- 'type' => 'wysiwyg'
- ),
- )
- );
- $meta_boxes[] = array(
- 'id' => 'special_skills',
- 'title' => 'Special Skills',
- 'pages' => array('trails'), // post type
- 'context' => 'normal',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'Special Skills',
- 'desc' => 'Enter Special Skills',
- 'id' => $prefix . 'special_skills',
- 'type' => 'wysiwyg'
- ),
- )
- );
- //Start Recipes Meta Fields
- $meta_boxes[] = array(
- 'id' => 'Recipe Details',
- 'title' => 'Recipe Details',
- 'pages' => array('recipes'), // post type
- 'context' => 'normal',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'Main Ingredient',
- 'desc' => 'Main Ingredient: Chicken, Beef, Pasta, etc...',
- 'id' => $prefix . 'main_ingredient',
- 'type' => 'text_medium'
- ),
- array(
- 'name' => 'Course',
- 'desc' => 'Select Course',
- 'id' => $prefix . 'course',
- 'type' => 'select',
- 'options' => array(
- array('name' => 'Appetizer', 'value' => 'Appetizer'),
- array('name' => 'Main Course', 'value' => 'Main Course'),
- array('name' => 'Side Dish', 'value' => 'Side Dish'),
- array('name' => 'Snack', 'value' => 'Snack'),
- array('name' => 'Beverage', 'value' => 'Beverage'),
- )
- ),
- array(
- 'name' => 'Best Use',
- 'desc' => 'Select Best Use',
- 'id' => $prefix . 'best_use',
- 'type' => 'select',
- 'options' => array(
- array('name' => 'Day Hiking', 'value' => 'Day Hiking'),
- array('name' => 'Backpacking', 'value' => 'Backpacking'),
- array('name' => 'Camping', 'value' => 'Camping'),
- array('name' => 'Multi-use', 'value' => 'Multi-use'),
- )
- ),
- array(
- 'name' => 'Level',
- 'desc' => 'Select Level',
- 'id' => $prefix . 'level',
- 'type' => 'select',
- 'options' => array(
- array('name' => 'Easy - like Mac & Cheese', 'value' => 'Easy - like Mac & Cheese'),
- array('name' => 'Moderate - requires some skills', 'value' => 'Moderate - requires some skills'),
- array('name' => 'Difficult - should only be attempted by an Iron Chef', 'value' => 'Difficult - should only be attempted by an Iron Chef'),
- )
- ),
- array(
- 'name' => 'Meal',
- 'desc' => 'Select Meal',
- 'id' => $prefix . 'meal',
- 'type' => 'select',
- 'options' => array(
- array('name' => 'Breakfast', 'value' => 'Breakfast'),
- array('name' => 'Lunch', 'value' => 'Lunch'),
- array('name' => 'Dinner', 'value' => 'Dinner'),
- array('name' => 'On The Move', 'value' => 'On the Move'),
- array('name' => 'Multi-use', 'value' => 'Multi-use'),
- )
- ),
- array(
- 'name' => 'Servings',
- 'desc' => 'How many people will this recipe feed?',
- 'id' => $prefix . 'servings',
- 'type' => 'text_small'
- ),
- )
- );
- $meta_boxes[] = array(
- 'id' => 'prep_time',
- 'title' => 'Prep Time',
- 'pages' => array('recipes'), // post type
- 'context' => 'normal',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'Prep Time Hours',
- 'desc' => 'Enter Hours',
- 'id' => $prefix . 'prep_time_hours',
- 'type' => 'text_small'
- ),
- array(
- 'name' => 'Prep Time Minutes',
- 'desc' => 'Enter Minutes',
- 'id' => $prefix . 'prep_time_minutes',
- 'type' => 'text_small'
- ),
- )
- );
- $meta_boxes[] = array(
- 'id' => 'cook_time',
- 'title' => 'Cook Time',
- 'pages' => array('recipes'), // post type
- 'context' => 'normal',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'Cook Time Hours',
- 'desc' => 'Enter Hours',
- 'id' => $prefix . 'cook_time_hours',
- 'type' => 'text_small'
- ),
- array(
- 'name' => 'Cook Time Minutes',
- 'desc' => 'Enter Minutes',
- 'id' => $prefix . 'cook_time_minutes',
- 'type' => 'text_small'
- ),
- )
- );
- $meta_boxes[] = array(
- 'id' => 'cooking_ingredients',
- 'title' => 'Cooking Ingredients',
- 'pages' => array('recipes'), // post type
- 'context' => 'normal',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'Cooking Ingredients',
- 'desc' => 'Please add 1 ingredient per line',
- 'id' => $prefix . 'cooking_ingredients',
- 'type' => 'wysiwyg'
- ),
- )
- );
- $meta_boxes[] = array(
- 'id' => 'cooking_instructions',
- 'title' => 'Cooking Instructions',
- 'pages' => array('recipes'), // post type
- 'context' => 'normal',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'Cooking Instructions',
- 'desc' => 'Enter Cooking Instructions (Select the Ordered list button. 5th icon above)',
- 'id' => $prefix . 'cooking_instructions',
- 'type' => 'wysiwyg'
- ),
- )
- );
- // Start Gear Reviews
- $meta_boxes[] = array(
- 'id' => 'gear_rating',
- 'title' => 'Rating',
- 'pages' => array('reviews'), // post type
- 'context' => 'side',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'Gear Rating',
- 'desc' => 'Select Gear Rating',
- 'id' => $prefix . 'gear_rating',
- 'type' => 'select',
- 'options' => array(
- array('name' => '1', 'value' => '1'),
- array('name' => '2', 'value' => '2'),
- array('name' => '3', 'value' => '3'),
- array('name' => '4', 'value' => '4'),
- array('name' => '5', 'value' => '5'),
- )
- ),
- )
- );
- $meta_boxes[] = array(
- 'id' => 'gear_price',
- 'title' => 'Price',
- 'pages' => array('reviews'), // post type
- 'context' => 'side',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'Gear Price',
- 'desc' => 'Enter Gear Price',
- 'id' => $prefix . 'gear_price',
- 'type' => 'text_money'
- ),
- )
- );
- $meta_boxes[] = array(
- 'id' => 'gear_best_use',
- 'title' => 'Best Use',
- 'pages' => array('reviews'), // post type
- 'context' => 'side',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'Best Use',
- 'desc' => 'Select Best Use',
- 'id' => $prefix . 'gear_best_use',
- 'type' => 'select',
- 'options' => array(
- array('name' => 'Day Hiking', 'value' => 'Day Hiking'),
- array('name' => 'Backpacking', 'value' => 'Backpacking'),
- array('name' => 'Camping', 'value' => 'Camping'),
- array('name' => 'Multi-Use', 'value' => 'Multi-use'),
- )
- ),
- )
- );
- $meta_boxes[] = array(
- 'id' => 'gear_location',
- 'title' => 'Where to Buy',
- 'pages' => array('reviews'), // post type
- 'context' => 'normal',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'Where to Buy',
- 'desc' => 'Enter Location to Display',
- 'id' => $prefix . 'gear_location',
- 'type' => 'text_medium'
- ),
- array(
- 'name' => 'Where to Buy',
- 'desc' => 'Enter Destination Location Link',
- 'id' => $prefix . 'gear_location_link',
- 'type' => 'text_medium'
- ),
- )
- );
- $meta_boxes[] = array(
- 'id' => 'testing_results',
- 'title' => 'Results of Testing',
- 'pages' => array('reviews'), // post type
- 'context' => 'normal',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'Testing Location',
- 'desc' => 'Enter where you tested this? Specify National Park or use area.',
- 'id' => $prefix . 'testing_results_location',
- 'type' => 'text_medium'
- ),
- array(
- 'name' => 'Time/Distance Tested',
- 'desc' => 'Enter how long you tested this or how many miles did you treked with it?',
- 'id' => $prefix . 'testing_results_distance',
- 'type' => 'text_medium'
- ),
- array(
- 'name' => 'Testing Environment',
- 'desc' => 'Enter the conditions ex. Windy, rainy, muddy, high or low temps, type of terrain',
- 'id' => $prefix . 'testing_results_environment',
- 'type' => 'text_medium'
- ),
- )
- );
- $meta_boxes[] = array(
- 'id' => 'bottom_line',
- 'title' => 'The Bottom Line',
- 'pages' => array('reviews'), // post type
- 'context' => 'normal',
- 'priority' => 'low',
- 'show_names' => false, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => 'The Bottom Line',
- 'desc' => 'Enter content for the bottom line',
- 'id' => $prefix . 'bottom_line',
- 'type' => 'wysiwyg'
- ),
- )
- );
- require_once('lib/post-type/metabox/init.php');
- function feeds_reviews() { ?>
- <div id="feeds-feedburner">
- <a href="http://feeds.feedburner.com/TrailSherpaReviews" rel="alternate" type="application/rss+xml"><img src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/TrailSherpaReviews" rel="alternate" type="application/rss+xml">Subscribe to Gear Reviews
- </a> | <a href="http://feedburner.google.com/fb/a/mailverify?uri=TrailSherpaReviews&loc=en_US">Subscribe to Gear Reviews by Email</a>
- </div>
- <?php }
- function feeds_recipes() { ?>
- <div id="feeds-feedburner">
- <a href="http://feeds.feedburner.com/TrailSherpaRecipes" rel="alternate" type="application/rss+xml"><img src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/TrailSherpaRecipes" rel="alternate" type="application/rss+xml">Subscribe to Recipes
- </a> | <a href="http://feedburner.google.com/fb/a/mailverify?uri=TrailSherpaRecipes&loc=en_US">Subscribe to Recipes by Email</a>
- </div>
- <?php }
- function feeds_reports() { ?>
- <div id="feeds-feedburner">
- <a href="http://feeds.feedburner.com/TrailSherpaTrailReports" rel="alternate" type="application/rss+xml"><img src="http://www.feedburner.com/fb/images/pub/feed-icon16x16.png" alt="" style="vertical-align:middle;border:0"/></a> <a href="http://feeds.feedburner.com/TrailSherpaTrailReports" rel="alternate" type="application/rss+xml">Subscribe to Trail Reports</a> | <a href="http://feedburner.google.com/fb/a/mailverify?uri=TrailSherpaTrailReports&loc=en_US">Subscribe Trail Reports by Email</a>
- </div>
- <?php }
- if ( current_user_can('contributor') && !current_user_can('upload_files') )
- add_action('admin_init', 'allow_contributor_uploads');
- function allow_contributor_uploads() {
- $contributor = get_role('contributor');
- $contributor->add_cap('upload_files');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement