php - Trying to create custom post type in Wordpress, keep getting parse error -



php - Trying to create custom post type in Wordpress, keep getting parse error -

the error i'm getting is:

parse error: syntax error, unexpected $end in /var/sites/c/xxxxxxxxxxxxxxxxx.co.uk/public_html/wp-content/themes/customtheme/vehicle-manager.php on line 76

i getting error when trying include vehicle-manager.php in functions.php using require_once function - it's not loading @ , can't seem remember i've changed!!

<?php add_action('init', 'vehicle_manager_register'); function vehicle_manager_register() { //arguments create post type. $args = array( 'label' => __('vehicle manager'), 'singular_label' => __('vehicle'), 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => true, 'has_archive' => true, 'supports' => array('title', 'editor', 'thumbnail'), 'rewrite' => array('slug' => 'vehicles', 'with_front' => false), ); //register type , custom taxonomy type. register_post_type( 'vehicle' , $args ); register_taxonomy("vehicle-type", array("vehicles"), array("hierarchical" => true, "label" => "vehicle types", "singular_label" => "vehicle type", "rewrite" => true, "slug" => 'vehicle-type')); //begin custom fields if (function_exists('add_theme_support')) { add_theme_support('post-thumbnails'); set_post_thumbnail_size( 220, 150 ); add_image_size('storefront', 800, 600, true); } add_action("admin_init", "vehicle_manager_add_meta"); function vehicle_manager_add_meta(){ add_meta_box("vehicle-meta", "vehicle options", "vehicle_manager_meta_options", "vehicles", "normal", "high"); } //start of actual custom fields function vehicle_manager_meta_options(){ global $post; if ( defined('doing_autosave') && doing_autosave ) homecoming $post_id; $custom = get_post_custom($post->id); $make= $custom["make"][0]; $model= $custom["model"][0]; $year= $custom["year"][0]; $mileage= $custom["mileage"][0]; $engine= $custom["engine"][0]; $colour = $custom["colour"][0]; $price = $custom["price"][0]; $uspa = $custom["uspa"][0]; $uspb = $custom["uspb"][0]; $uspc = $custom["uspc"][0]; ?> <style type="text/css"> <?php include('vehicle-manager.css'); ?> </style> <div class="vehicle_manager_extras"> <div><label>make:</label><input name="make" value="<?php echo $make; ?>" /></div> <div><label>model</label><input name="model" value="<?php echo $model; ?>" /></div> <div><label>year:</label><input name="year" value="<?php echo $year; ?>" /></div> <div><label>miles:</label><input name="miles" value="<?php echo $miles; ?>" /></div> <div><label>engine:</label><input name="engine" value="<?php echo $engine; ?>" /></div> <div><label>colour:</label><input name="colour" value="<?php echo $colour; ?>" /></div> <div><label>price:</label><input name="price" value="<?php echo $price; ?>" /></div> <div><label>feature 1 (optional):</label><input name="uspa" value="<?php echo $uspa; ?>" /></div> <div><label>feature 2 (optional):</label><input name="uspb" value="<?php echo $uspb; ?>" /></div> <div><label>feature 3 (optional):</label><input name="uspc" value="<?php echo $uspc; ?>" /></div> </div> <?php } ?>

the problem first function never closed.

add } before //begin custom field close function vehicle_manager_register().

this should solve problem.

the error unexpected $end means opened bracket, hasn't been closed before end of document.

php html wordpress

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -