コード例 #1
0
get_header();
?>
		<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
	 
		<?php 
        global $options;
        $fields;
        $options2;
        $options3;
        $symbols;
        $fields = get_post_meta($post->ID, 'mod1', true);
        $options = my_get_theme_options();
        $options2 = get_post_meta($post->ID, 'mod2', true);
        $options3 = get_post_meta($post->ID, 'mod3', true);
        $symbols = get_option('gorilla_symbols');
        ?>
<div class="tri-col-span right detail-page"></div>
   		<?php 
        cps_ajax_search_results();
        ?>
    
            <div class="detail-page-content hideOnSearch">
               <div class="clear"></div>
				<h1 class="hideOnSearch"><?php 
        if ($fields['year']) {
            echo $fields['year'];
        } else {
コード例 #2
0
    function widget($args, $instance)
    {
        $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
        $title2 = empty($instance['title2']) ? ' ' : apply_filters('widget_title', $instance['title2']);
        $text2 = apply_filters('widget_textarea', empty($instance['text2']) ? '' : $instance['text2'], $instance);
        $title3 = empty($instance['title3']) ? ' ' : apply_filters('widget_title', $instance['title3']);
        $text3 = apply_filters('widget_textarea', empty($instance['text3']) ? '' : $instance['text3'], $instance);
        $title4 = empty($instance['title4']) ? ' ' : apply_filters('widget_title', $instance['title4']);
        $text4 = apply_filters('widget_textarea', empty($instance['text4']) ? '' : $instance['text4'], $instance);
        ?>
	
<div class="specs side-lift-block" >
  <ul class="refine-nav">
    <?php 
        if (empty($instance['title'])) {
            echo '';
        } else {
            ?>
    <li class="first"> <span><?php 
            echo $title;
            ?>
</span>
      <?php 
            global $post, $fields, $fields2, $fields3, $options, $symbols;
            $fields = get_post_meta($post->ID, 'mod1', true);
            $fields2 = get_post_meta($post->ID, 'mod2', true);
            $fields3 = get_post_meta($post->ID, 'mod3', true);
            $symbols = get_option('gorilla_symbols');
            $options = my_get_theme_options();
            ?>
      <ul>
        <li>
          <?php 
            if ($fields['drive']) {
                echo '<p class="strong">' . $options['drive_text'] . ': </p>' . $fields['drive'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['enginetype']) {
                echo '<p class="strong">' . $options['engine_type_text'] . ': </p>' . $fields2['enginetype'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['cylinders']) {
                echo '<p class="strong">' . $options['number_cylinders_text'] . ': </p>' . $fields2['cylinders'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['horsepower']) {
                echo '<p class="strong">' . $options['horsepower_text'] . ': </p>' . $fields2['horsepower'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['torque']) {
                echo '<p class="strong">' . $options['torque_text'] . ': </p>' . $fields2['torque'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['enginesize']) {
                echo '<p class="strong">' . $options['engine_size_text'] . ': </p>' . $fields2['enginesize'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['bore']) {
                echo '<p class="strong">' . $options['bore_text'] . ': </p>' . $fields2['bore'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['stroke']) {
                echo '<p class="strong">' . $options['stroke_text'] . ': </p>' . $fields2['stroke'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['valvespercylinder']) {
                echo '<p class="strong">' . $options['valves_text'] . ': </p>' . $fields2['valvespercylinder'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['fuelcapacity']) {
                echo '<p class="strong">' . $options['fuel_capacity_text'] . ': </p>' . $fields2['fuelcapacity'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields['epamileage']) {
                echo '<p class="strong">' . $options['epa_mileage_text'] . ': </p>' . $fields['epamileage'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
        <?php 
            if ($fields['EPA_CITY_MPG']) {
                echo '<li><p class="strong">' . _('EPA City MPG:', 'language') . '</p> ' . $fields['EPA_CITY_MPG'] . '</li>';
            } else {
                echo '';
            }
            ?>
		</li>			   						
   		<li>				   				  						   						   	<?php 
            if ($fields['EPA_HIGHWAY_MPG']) {
                echo '<li><p class="strong">' . _('EPA Highway MPG:', 'language') . '</p> ' . $fields['EPA_HIGHWAY_MPG'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>
   		<li>				   				  						   						   	<?php 
            if ($fields2['FRONT_AIR_CONDITIONING']) {
                echo '<li><p class="strong">' . _('Front Air Conditioning:', 'language') . '</p> ' . $fields2['FRONT_AIR_CONDITIONING'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>				   						   					
        <li>				   				  						   						   	<?php 
            if ($fields2['FRONT_BRAKE_TYPE']) {
                echo '<li><p class="strong">' . _('Front Brake Type:', 'language') . '</p> ' . $fields2['FRONT_BRAKE_TYPE'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>			
        <li>				   				  						   						   	<?php 
            if ($fields2['ANTILOCK_BRAKING_SYSTEM']) {
                echo '<li><p class="strong">' . _('Antilock Braking System:', 'language') . '</p> ' . $fields2['ANTILOCK_BRAKING_SYSTEM'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>	
        <li>				   				  						   						   	<?php 
            if ($fields2['BRAKING_ASSIST']) {
                echo '<li><p class="strong">' . _('Braking Assist:', 'language') . '</p> ' . $fields2['BRAKING_ASSIST'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>	        
        <li>				   				  						   						   	<?php 
            if ($fields2['REAR_BRAKE_DIAMETER']) {
                echo '<li><p class="strong">' . _('Rear Brake Diameter:', 'language') . '</p> ' . $fields2['REAR_BRAKE_DIAMETER'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>        
        <li>				   				  						   						   	<?php 
            if ($fields2['AUTO_DIMMING_REARVIEW_MIRROR']) {
                echo '<li><p class="strong">' . _('Auto Dimming Rearview Mirror:', 'language') . '</p> ' . $fields2['AUTO_DIMMING_REARVIEW_MIRROR'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>  
        <li>				   				  						   						   	<?php 
            if ($fields2['RUNNING_BOARDS']) {
                echo '<li><p class="strong">' . _('Running Boards:', 'language') . '</p> ' . $fields2['RUNNING_BOARDS'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>    		
        <li>				   				  						   						   	<?php 
            if ($fields2['ROOF_RACK']) {
                echo '<li><p class="strong">' . _('Roof Rack:', 'language') . '</p> ' . $fields2['ROOF_RACK'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>    		
        <li>				   				  						   						   	<?php 
            if ($fields2['POWER_DOOR_LOCKS']) {
                echo '<li><p class="strong">' . _('Power Door Locks:', 'language') . '</p> ' . $fields2['POWER_DOOR_LOCKS'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>    	   		
        <li>				   				  						   						   	<?php 
            if ($fields2['ANTI_THEFT_ALARM_SYSTEM']) {
                echo '<li><p class="strong">' . _('Anti Theft Alarm System:', 'language') . '</p> ' . $fields2['ANTI_THEFT_ALARM_SYSTEM'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>     		
        <li>				   				  						   						   	<?php 
            if ($fields2['CRUISE_CONTROL']) {
                echo '<li><p class="strong">' . _('Cruise Control:', 'language') . '</p> ' . $fields2['CRUISE_CONTROL'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>
   		<li>				   				  						   						   	<?php 
            if ($fields2['1ST_ROW_VANITY_MIRRORS']) {
                echo '<li><p class="strong">' . _('First Row Vanity Mirros:', 'language') . '</p> ' . $fields2['1ST_ROW_VANITY_MIRRORS'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li> 
   		<li>				   				  						   						   	<?php 
            if ($fields2['HEATED_DRIVER_SIDE_MIRROR']) {
                echo '<li><p class="strong">' . _('Heated Driver Side Mirror:', 'language') . '</p> ' . $fields2['HEATED_DRIVER_SIDE_MIRROR'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>  
   		<li>				   				  						   						   	<?php 
            if ($fields2['HEATED_PASSENGER_SIDE_MIRROR']) {
                echo '<li><p class="strong">' . _('Heated Driver Passenger Mirror:', 'language') . '</p> ' . $fields2['HEATED_PASSENGER_SIDE_MIRROR'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li> 
   		<li>				   				  						   						   	<?php 
            if ($fields2['TRAILER_WIRING']) {
                echo '<li><p class="strong">' . _('Trailer Wiring:', 'language') . '</p> ' . $fields2['TRAILER_WIRING'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>    		
   		<li>				   				  						   						   	<?php 
            if ($fields2['TRAILER_HITCH']) {
                echo '<li><p class="strong">' . _('Trailer Hitch:', 'language') . '</p> ' . $fields2['TRAILER_HITCH'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>    		
   		<li>				   				  						   						   	<?php 
            if ($fields2['CRUISE_CONTROLS_ON_STEERING_WHEEL']) {
                echo '<li><p class="strong">' . _('Cruise Control on Steering Wheel:', 'language') . '</p> ' . $fields2['CRUISE_CONTROLS_ON_STEERING_WHEEL'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>     		     		
   		<li>				   				  						   						   	<?php 
            if ($fields2['AUDIO_CONTROLS_ON_STEERING_WHEEL']) {
                echo '<li><p class="strong">' . _('Audio Control on Steering Wheel:', 'language') . '</p> ' . $fields2['AUDIO_CONTROLS_ON_STEERING_WHEEL'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>    		
   		<li>				   				  						   						   	<?php 
            if ($fields2['FOLDING_2ND_ROW']) {
                echo '<li><p class="strong">' . _('Folding Second Row Seats:', 'language') . '</p> ' . $fields2['FOLDING_2ND_ROW'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>
   		<li>				   				  						   						   	<?php 
            if ($fields2['1ST_ROW_POWER_OUTLET']) {
                echo '<li><p class="strong">' . _('First Row Power Outlet:', 'language') . '</p> ' . $fields2['1ST_ROW_POWER_OUTLET'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>       		
   		<li>				   				  						   						   	<?php 
            if ($fields2['CARGO_AREA_POWER_OUTLET']) {
                echo '<li><p class="strong">' . _('Cargo Area Power Outlet:', 'language') . '</p> ' . $fields2['CARGO_AREA_POWER_OUTLET'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li> 
   		<li>				   				  						   						   	<?php 
            if ($fields2['INDEPENDENT_SUSPENSION']) {
                echo '<li><p class="strong">' . _('Independent Suspension:', 'language') . '</p> ' . $fields2['INDEPENDENT_SUSPENSION'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>  
   		<li>				   				  						   						   	<?php 
            if ($fields2['REAR_SUSPENSION_TYPE']) {
                echo '<li><p class="strong">' . _('Independent Suspension:', 'language') . '</p> ' . $fields2['REAR_SUSPENSION_TYPE'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>
   		<li>				   				  						   						   	<?php 
            if ($fields2['FRONT_SUSPENSION_TYPE']) {
                echo '<li><p class="strong">' . _('Rear Suspension Type:', 'language') . '</p> ' . $fields2['FRONT_SUSPENSION_TYPE'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li> 
   		<li>				   				  						   						   	<?php 
            if ($fields2['MAX_CARGO_CAPACITY']) {
                echo '<li><p class="strong">' . _('Maximum Cargo Capacity Suspension:', 'language') . '</p> ' . $fields2['MAX_CARGO_CAPACITY'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>         		
   		<li>				   				  						   						   	<?php 
            if ($fields2['PASSENGER_AIRBAG']) {
                echo '<li><p class="strong">' . _('Passenger Airbags:', 'language') . '</p> ' . $fields2['PASSENGER_AIRBAG'] . '</li>';
            } else {
                echo '';
            }
            ?>
   		</li>    		
        <li>
          <?php 
            if ($fields2['wheelbase']) {
                echo '<p class="strong">' . $options['wheelbase_text'] . ': </p>' . $fields2['wheelbase'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['overalllength']) {
                echo '<p class="strong">' . $options['overall_length_text'] . ': </p>' . $fields2['overalllength'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['width']) {
                echo '<p class="strong">' . $options['width_text'] . ': </p>' . $fields2['width'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['height']) {
                echo '<p class="strong">' . $options['height_text'] . ': </p>' . $fields2['height'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['curbweight']) {
                echo '<p class="strong">' . $options['curb_weight_text'] . ': </p>' . $fields2['curbweight'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['legroom']) {
                echo '<p class="strong">' . $options['leg_room_text'] . ': </p>' . $fields2['legroom'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['headroom']) {
                echo '<p class="strong">' . $options['head_room_text'] . ': </p>' . $fields2['headroom'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['seatingcapacity']) {
                echo '<p class="strong">' . $options['seating_text'] . ': </p>' . $fields2['seatingcapacity'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields2['tires']) {
                echo '<p class="strong">' . $options['tires_text'] . ': </p>' . $fields2['tires'];
            } else {
                echo '';
            }
            ?>
        </li>
        <li>
          <?php 
            if ($fields['transmission']) {
                echo '<p class="strong">' . $options['transmission_text'] . ': </p>' . $fields['transmission'];
            } else {
                echo '';
            }
            ?>
        </li>
      </ul>
    </li>
    <?php 
        }
        ?>
    <?php 
        if (empty($instance['title2'])) {
            echo '';
        } else {
            ?>
    <li class="second"> <span><?php 
            echo $title2;
            ?>
</span>
      <ul>
        <li><?php 
            echo $text2;
            ?>
</li>
      </ul>
    </li>
    <?php 
        }
        ?>
    <?php 
        if (empty($instance['title3'])) {
            echo '';
        } else {
            ?>
    <li class="third"> <span><?php 
            echo $title3;
            ?>
</span>
      <ul>
        <?php 
            echo $text3;
            ?>
      </ul>
    </li>
    <?php 
        }
        ?>
    <?php 
        if (empty($instance['title4'])) {
            echo '';
        } else {
            ?>
    <li class="fourth"> <span><?php 
            echo $title4;
            ?>
</span>
      <ul>
        <?php 
            echo $text4;
            ?>
      </ul>
    </li>
    <?php 
        }
        ?>
  </ul>
</div>
<?php 
    }
コード例 #3
0
function my_settings_field_transmission_text_input()
{
    $options = my_get_theme_options();
    ?>
	
	<input type="text" name="my_theme_options[transmission_text]" id="transmission-text-input" value="<?php 
    echo esc_attr($options['transmission_text']);
    ?>
" />
		<div style="padding:5px 0;"></div>
	<li class='li'><strong><?php 
    _e('Option 1:', 'language');
    ?>
</strong>&nbsp;&nbsp;<input type="text" name="my_theme_options[transmission_1]" id="transmission-text-input" value="<?php 
    echo esc_attr($options['transmission_1']);
    ?>
" /></li>
	
	<li class='lialt'><strong><?php 
    _e('Option 2:', 'language');
    ?>
</strong>&nbsp;&nbsp;<input type="text" name="my_theme_options[transmission_2]" id="transmission-text-input" value="<?php 
    echo esc_attr($options['transmission_2']);
    ?>
" /></li>
	
	<li class='li'><strong><?php 
    _e('Option 3:', 'language');
    ?>
</strong>&nbsp;&nbsp;<input type="text" name="my_theme_options[transmission_3]" id="transmission-text-input" value="<?php 
    echo esc_attr($options['transmission_3']);
    ?>
" /></li>
	
	<li class='lialt'><strong><?php 
    _e('Option 4:', 'language');
    ?>
</strong>&nbsp;&nbsp;<input type="text" name="my_theme_options[transmission_4]" id="transmission-text-input" value="<?php 
    echo esc_attr($options['transmission_4']);
    ?>
" /></li>	
	<?php 
}
コード例 #4
0
function meta_box_callback($post)
{
    global $options;
    $fields;
    $options2;
    $options3;
    $symbols;
    $fields = get_post_meta($post->ID, 'mod1', true);
    $symbols = get_option('gorilla_symbols');
    $options = my_get_theme_options();
    $values = get_post_custom($post->ID);
    $selected = isset($values['meta_box_craigslist_embed']) ? $values['meta_box_craigslist_embed'][0] : '';
    wp_nonce_field('my_meta_box_nonce', 'meta_box_nonce');
    ?>
 
<p style="border-bottom:1px solid #f1f1f1;padding-bottom:3px;"><div style="height:200px;width:130px;padding:6px 0 0 5px;font-size:12px;color:#252525; font-style:normal;font-weight:bold;float: left;"><?php 
    _e('Craigslist Code:', 'language');
    ?>
<br/><br/><span
 style="font-weight:normal!important;font-size:11px;margin-top:15px;font-style:italic;"><?php 
    echo _e('Copy & Paste the generated code into your Craigslist ad.', 'language');
    ?>
</span></div></p>
<textarea name="meta_box_craigslist_embed" id="meta_box_craigslist_embed" style="width:80%;height:300px;" ><h1><?php 
    if (isset($fields['year'])) {
        echo $fields['year'];
        echo ' ';
    } else {
        echo '';
    }
    the_title();
    ?>
</h1><hr /><b><?php 
    _e('Contact:', 'language');
    ?>
</b> <?php 
    echo $symbols['phone'];
    ?>
<b><?php 
    _e('Website:', 'language');
    ?>
</b> <a href="<?php 
    the_permalink();
    ?>
"><?php 
    the_title();
    ?>
</a><ul><?php 
    if (isset($fields['price'])) {
        echo '<li>' . $options['price_text'] . ': ' . $symbols['currency'];
        echo $fields['price'] . '</li>';
    } else {
        echo '';
    }
    if (isset($fields['miles'])) {
        echo '<li>' . $options['miles_text'] . ': ' . $fields['miles'] . '</li>';
    } else {
        echo '';
    }
    if (isset($fields['vehicletype'])) {
        echo '<li>' . $options['vehicle_type_text'] . ': ' . $fields['vehicletype'] . '</li>';
    } else {
        echo '';
    }
    if (isset($fields['drive'])) {
        echo '<li>' . $options['drive_text'] . ': ' . $fields['drive'] . '</li>';
    } else {
        echo '';
    }
    if (isset($fields['transmission'])) {
        echo '<li>' . $options['transmission_text'] . ': ' . $fields['transmission'] . '</li>';
    } else {
        echo '';
    }
    ?>
</ul></td><td><ul><?php 
    if (isset($fields['exterior'])) {
        echo '<li>' . $options['exterior_text'] . ': ' . $fields['exterior'] . '</li>';
    } else {
        echo '';
    }
    if (isset($fields['interior'])) {
        echo '<li>' . $options['interior_text'] . ':' . $fields['interior'] . '</li>';
    } else {
        echo '';
    }
    if (isset($fields['epamileage'])) {
        echo '<li>' . $options['epa_mileage_text'] . ': ' . $fields['epamileage'] . '</li>';
    } else {
        echo '';
    }
    if (isset($fields['stock'])) {
        echo '<li>' . $options['stock_text'] . ': ' . $fields['stock'] . '</li>';
    } else {
        echo '';
    }
    if (isset($fields['vin'])) {
        echo '<li>' . $options['vin_text'] . ': ' . $fields['vin'] . '</li>';
    } else {
        echo '';
    }
    ?>
</ul><br/><a href="<?php 
    the_permalink();
    ?>
"><strong><?php 
    _e('VIEW PHOTO GALLERY AND FULL VEHICLE DETAILS', 'language');
    ?>
</strong></a><br/><p><b><?php 
    _e('Description', 'language');
    ?>
</b></p><p><?php 
    $trim_length = 200;
    $values = get_post_meta($post->ID, 'mod3', true);
    if (is_array($values)) {
        foreach ($values as $value) {
            add_filter('custom_filter', 'wpautop');
            echo apply_filters('custom_filter', $value);
        }
    }
    ?>
<p><b><?php 
    _e('Features', 'language');
    ?>
</b></p><p></p><?php 
    if (get_the_terms($post->ID, 'features')) {
        $taxonomy = get_the_terms($post->ID, 'features');
        foreach ($taxonomy as $taxonomy_term) {
            ?>
<li style="float: left;position: relative;overflow: hidden;width: 207px;padding: 10px 0px;padding-left: 24px;margin: 0px 4px 0 4px; border-bottom: 1px dotted grey;"><?php 
            echo $taxonomy_term->name;
            ?>
</li><?php 
        }
    }
    ?>
<br/><a href="<?php 
    the_permalink();
    ?>
"><strong><?php 
    _e('VIEW PHOTO GALLERY AND FULL VEHICLE DETAILS', 'language');
    ?>
</strong></textarea><?php 
}
コード例 #5
0
function features()
{
    $options = my_get_theme_options();
    $labels = array('name' => ucfirst($options['features_text']), 'taxonomy general name', 'singular_name' => ucfirst($options['features_text']), 'taxonomy singular name', 'search_items' => __('Search ', 'language') . ucfirst($options['features_text']), 'all_items' => __('All ', 'language') . ucfirst($options['features_text']), 'parent_item' => __('Parent', 'language') . ucfirst($options['features_text']), 'parent_item_colon' => __('Parent ', 'language') . ucfirst($options['features_text']) . ':', 'edit_item' => __('Edit ', 'language') . ucfirst($options['features_text']), 'update_item' => __('Update ', 'language') . ucfirst($options['features_text']), 'add_new_item' => __('Add New ', 'language') . ucfirst($options['features_text']), 'new_item_name' => __('New ', 'language') . ucfirst($options['features_text']) . ' Name');
    register_taxonomy('features', array('gtcd', 'user_listing'), array('hierarchical' => false, 'label' => ucfirst($options['features_text']), 'public' => true, 'can_export' => true, 'show_tagcloud' => true, 'labels' => $labels));
}
コード例 #6
0
function cps_display_taxonomy_search_form($taxonomy_names)
{
    $options = my_get_theme_options();
    if (isset($options['state_hide']) && $options['state_hide'] == "off") {
        ?>
<script type="text/javascript">
    $(function()
    {
        $('#location').change(function()
        {
            var $mainCat=$('#location :selected').attr('data-value');
            if(!$mainCat){
                $mainCat = $('#location').val();
            }
            // .call ajax
            $("#city").empty();
            $.ajax
            (
            {
                url:"<?php 
        bloginfo('wpurl');
        ?>
/wp-admin/admin-ajax.php", 
                type:'POST',
                data:'action=call_location&main_catid=' + $mainCat,
                success:function(results)
                {
                    options = $(results);
if(options.length > 1){
$("#city").removeAttr("disabled"); 
} else {
if(!$("#city").is(':disabled')){
$("#city").attr("disabled", "disabled"); 
}
}
$("#city").append(results); 
$("#city").selectBox('destroy');
$("#city").selectBox();    
                }
            }
        ); 
        });
    }); 
</script>             
<?php 
        wp_dropdown_categories(array('orderby' => 'name', 'order' => 'ASC', 'show_count' => '0', 'selected' => '1', 'hierarchical' => '1', 'depth' => '1', 'hide_empty' => '1', 'exclude' => '1', 'class' => 'dropdown', 'show_option_none' => __('Select State', 'language'), 'option_none_value' => '', 'name' => 'location', 'taxonomy' => 'location', 'walker' => new Walker_CategoryDropdown_Custom()));
        ?>

<select name="location" id="city"  class="dropdown" disabled="disabled"><option value=""><?php 
        _e('Select City', 'language');
        ?>
</option></select>
<?php 
    } else {
        echo '';
    }
    if (isset($options['make_hide']) && $options['make_hide'] == "off") {
        ?>
<script type="text/javascript">
    $(function()
    {      
        $('#makemodel').change(function()
        {
            var $mainCat=$('#makemodel :selected').attr('data-value');
            if(!$mainCat){
                $mainCat = $('#makemodel').val();
            }
            $("#model").empty();
            $.ajax
            (
            {
                url:"<?php 
        bloginfo('wpurl');
        ?>
/wp-admin/admin-ajax.php", 
                type:'POST',
                data:'action=name_call&main_catid=' + $mainCat,
                success:function(results)
                {
                    options = $(results);
if(options.length > 1){
$("#model").removeAttr("disabled"); 
} else {
if(!$("#model").is(':disabled')){
$("#model").attr("disabled", "disabled"); 
}
}
$("#model").append(results); 
$("#model").selectBox('destroy');
$("#model").selectBox();                     
                }
            }
        ); 
        });
    }); 
</script>             
<?php 
        wp_dropdown_categories(array('orderby' => 'name', 'order' => 'ASC', 'show_count' => '1', 'selected' => '1', 'hierarchical' => '1', 'depth' => '1', 'hide_empty' => '0', 'exclude' => '1', 'class' => 'dropdown', 'show_option_none' => __('Select Make', 'language'), 'option_none_value' => '', 'name' => 'makemodel', 'taxonomy' => 'makemodel', 'walker' => new Walker_CategoryDropdown_Custom()));
        ?>
<select name="makemodel" id="model"  class="dropdown" disabled="disabled"><option value=""><?php 
        _e('Select Model', 'language');
        ?>
</option></select>
<?php 
    } else {
        echo '';
    }
}
コード例 #7
0
function gtcd_custom_columns($column)
{
    global $post;
    switch ($column) {
        case 'image':
            // get new galley images
            $saved = get_post_custom_values('CarsGallery', get_the_ID());
            $saved = explode(',', $saved[0]);
            if (count($saved) > 0) {
                ?>
					
				<style type="text/css" media="screen">
				img{ background:#eee; padding:10px;border: 1px solid #ddd;margin-bottom: 14px;}				
				</style>

					<a href="<?php 
                the_permalink();
                ?>
">
						<div style="padding-top:16px!important;">
						<?php 
                //gorilla_img('admin_photo');
                $attachmentimage = wp_get_attachment_image($saved[0], 'admin_photo');
                echo $attachmentimage;
                ?>
                        </div>
					</a>
					<?php 
            }
            break;
        case 'pinfo':
            global $fields, $options, $symbols, $agent;
            $fields = get_post_meta($post->ID, 'mod1', true);
            $options = my_get_theme_options();
            $symbols = get_option('gorilla_symbols');
            if (empty($fields['price'])) {
                if (!isset($fields['price'])) {
                    0;
                } else {
                    $fields['price'];
                }
            }
            if (empty($symbols['currency'])) {
                $symbols['currency'] = '$';
            }
            if (empty($symbols['metric'])) {
                $symbols['metric'] = 'miles';
            }
            echo '<div style="color:#454d51;margin:5px 0 0px 0!important;font-weight:bold;font-size:16px;">' . get_the_title() . '</div>';
            if (!empty($fields['price'])) {
                echo '<div style="font-weight:bold;font-size:16px;color:#0d5b8c!important;margin:5px 0!important;">' . $symbols['currency'] . number_format($fields['price']) . '</div>';
            }
            if (!empty($fields['miles'])) {
                echo '<div style="color:#454d51;margin-bottom:5px;">' . $options['miles_text'] . '<span>: ' . $fields['miles'] . '</div>';
            } else {
                echo '';
            }
            if (!empty($fields['stock'])) {
                echo '<div style="color:#454d51;margin:0 5px 5px 0;"><span style="font-weight:bold">' . $options['stock_text'] . '#</span>: ' . $fields['stock'] . '</div>';
            } else {
                echo '';
            }
            if (!empty($fields['drive'])) {
                echo '<div style="color:#454d51;margin:0 5px 5px 0;"><span style="font-weight:bold">' . $options['drive_text'] . '</span>: ' . $fields['drive'] . '</div>';
            } else {
                echo '';
            }
            if (!empty($fields['exterior'])) {
                echo '<div style="color:#454d51;margin:0 5px 5px 0;"><span style="font-weight:bold">' . $options['exterior_text'] . '</span>: ' . $fields['exterior'] . '</div>';
            } else {
                echo '';
            }
            if (!empty($fields['interior'])) {
                echo '<div style="color:#454d51;margin:0 5px 5px 0;"><span style="font-weight:bold">' . $options['interior_text'] . '</span>: ' . $fields['interior'] . '</div>';
            } else {
                echo '';
            }
            if (!empty($fields['vin'])) {
                echo '<div style="color:#454d51;"><span style="font-weight:bold">' . $options['vin_text'] . '</span>: ' . $fields['vin'] . '</div>';
            } else {
                echo '';
            }
            break;
    }
}