show category name of custom post type
-
I have site for cars offers which contain: maker, model, year, fuel type… etc. I have shortcode which display short info about offer enter image description here
I want to replace “Fuel cons” with “Fuel type” and “Mileage” with “Gearbox type”
This is the php file for registered categories:
//Fuel Types register_taxonomy($post_type . '_fuel_type', array($post_type), array( 'hierarchical' => false, 'labels' => array ( 'name' => TF_SEEK_HELPER::get_option('seek_property_name_singular') .' '.__( 'Fuel Types','tfuse' ), 'singular_name' => TF_SEEK_HELPER::get_option('seek_property_name_singular') .' '. __( 'Fuel Type','tfuse' ), 'search_items' => __( 'Search','tfuse'). ' ' . TF_SEEK_HELPER::get_option('seek_property_name_singular') .' '.__('Fuel Types','tfuse' ), 'all_items' => __( 'All','tfuse') .' '. TF_SEEK_HELPER::get_option('seek_property_name_singular') .' '. __('Fuel Types','tfuse' ), 'edit_item' => __( 'Edit','') .' '. TF_SEEK_HELPER::get_option('seek_property_name_singular') .' '. __('Fuel Type','tfuse' ), 'update_item' => __( 'Update','tfuse') .' '. TF_SEEK_HELPER::get_option('seek_property_name_singular') .' '. __('Fuel Type','tfuse' ), 'add_new_item' => __( 'Add New Type','tfuse' ), 'new_item_name' => __( 'New','tfuse') .' '. TF_SEEK_HELPER::get_option('seek_property_name_singular') .' '. __('Fuel Type Name','tfuse' ), 'menu_name' => __('Fuel Types','tfuse' ), ), 'show_ui' => true, 'public' => true, 'query_var' => true, 'rewrite' => array( 'slug' => apply_filters( 'tfuse_vehicle_fuel_slug', $post_type . '_fuel' ), 'with_front' => true ), 'capabilities' => array( ) ) );
And this is the code for shortcode:
$html .= '<div class="special_offers"> <h2>'.tfuse_qtranslate($title).'</h2> <div id="special_offers">'; $price_symbol = TF_SEEK_HELPER::get_option("seek_property_currency_symbol","$"); $fuel_symbol = TF_SEEK_HELPER::get_option("seek_property_consumption_symbol","MPG"); foreach($posts_array as $vehicle){ $vehicle_link = get_permalink($vehicle); $image = new TF_GET_IMAGE(); $img = $image->width(310)->height(134)->src(tfuse_get_vehicle_thumbnail($vehicle->ID))->get_img(); $price = TF_SEEK_HELPER::get_post_option('property_price', 0, $vehicle->ID); $fuel = apply_filters('tfuse_fuel_number_format', TF_SEEK_HELPER::get_post_option('property_consumption', 0, $vehicle->ID)); $date = '01/'.TF_SEEK_HELPER::get_post_option('property_year', '11/2010', $vehicle->ID); $date = date("d/m/Y", strtotime($date)); $date = strtoupper(date("M Y",strtotime($date))); $fuel_out = apply_filters('tfuse_power_fuel_symbol_position', tfuse_symbol_position($fuel, $fuel_symbol, 1, ' ', true), $fuel, $fuel_symbol); $price_number_str = apply_filters( 'tfuse_price_number_format', number_format($price,0,'', '.'), $price ); $price_symbol_str = '<span class="symbol_price_left">' . $price_symbol .'</span>'; $price_symbol_pos = TF_SEEK_HELPER::get_option('seek_property_currency_symbol_pos', 0); $out = tfuse_symbol_position($price_number_str, $price_symbol_str, $price_symbol_pos, '', true);
- The topic ‘show category name of custom post type’ is closed to new replies.