Customize Categories on the ClassiPress Search Form

The ClassiPress Search Form includes a dropdown list of ads categories, which allows refining search results by a selected category.

ClassiPress Search Form

It uses the WordPress function wp_dropdown_categories() to generate categories dropdown list HTML with a set of options that provides the ClassiPress function cp_get_dropdown_categories_search_args(). This function has a filter cp_dropdown_search_bar_args which you can use for complete customizing the Categories dropdown.

This is how it looks by default:

Default ClassiPress search categories dropdown list

Below you will find the filter specification and some useful customization examples.

Filter 'cp_dropdown_search_bar_args' parameters 'show_option_all' - (string) Text to display for showing all categories. Default "All Categories"'show_option_none' - (string) Text to display for showing no categories. Default empty.'option_none_value' - (string) Value to us…
Read more about Customize Categories on the ClassiPress Search Form
  • 36

Limit location dropdown for a specific country only

Let me show you an easy way to limit a country in location search dropdown and address field auto-suggest.

This mod will work only for WordPress themes ClassiPress v4.1.0+, Vantage v4.2.0+ and JobRoller v1.9.0+, which implement the AppMaps Geo framework by AppThemes. The Google Maps is the only supported AppMaps provider for this mod. Means, it will not work with Bing or MapQuest providers.

AppThemes themes implementing AppMaps framework have option "Region Biasing", which limits the country in location dropdown in soft way. It will suggest locations related to the selected country in the first places, but still, allow the other countries options select at the end of the list.

However, if you want to limit the country in strict way, i.e. do not allow to enter any other countries except selected, you would need to add the following code in your theme JS scripts file.

( function( $ ) { $( document ).on( 'appaddressautocompleteready', func…
Read more about Limit location dropdown for a specific country only
  • 0

Dedicated Banner upload field for the Vantage

This mod is for Vantage users who want to use a special custom field for the listing page banner upload.

Time needed: 5 minutes.

By default, the Vantage theme uses the first available image for the listing thumbnail and the page banner. This might not be convenient. Especially when users use logo images in thumbnails, which appears on the banner.This is definitely a UX issue and it will be fixed in the next versions of the Vantage theme. In this article, we'll show you how to fix it with a small code snippet before the official release.

Create new File Upload field

Open Vantage → Forms and create new File Upload field with name Banner Image. Set "Image" for Allowed Extensions parameter. File limit 1, embed limit 0. The name of the field in example app_banner-image.

Add PHP code snippet

You can use Code Snippets plu…

Read more about Dedicated Banner upload field for the Vantage
  • 6

How to make foldable Ad packages with CP Addons plugin

CP Addons plugin displays options for each Ad Package on an ad submit form. It replaces standard ClassiPress Ad packages drop-down with an expanded list of options. This instruction helps to make Ad Packages options foldable and display only options for selected package.

So, the default layout you can see on the image below.

CP Addons options for each Ad Package, default layout

There are separated sections for each price package, every section includes a list of add-ons. Packages can have different number of add-ons, depending on Include/ Exclude options. A user will see the full list of packages on the Create Ad page.

This looks pretty fine if you use few Ad Packages and Addons. Otherwise, you'll get a very long list of options.

To reduce this list, you may want to dynamically display Addons options only for selected Ad Package.

CP Addons options for each Ad Package, foldable layout

Unfortunately, currently there is …

Read more about How to make foldable Ad packages with CP Addons plugin
  • 0

Replace ClassiPress Location Search field with a custom field dropdown

A detailed instruction on how to replace Location Search field with a custom field dropdown on your WordPress ClassiPress site.

The default ClassiPress search bar has three fields:

Search keywordsLocationCategories

The ClassiPress Location field needs to refine search results to some geographic location. It can use the Google Places API for a location autocomplete and radius search or it may take a simple string to compare against ads address fields.

The following mod replaces default location field with a States dropdown list and allows restricting search results to a specific state.

This method can be applied for any field of the drop-down or checkbox type, such as Country, Region, Size, Color, etc.

The mod should be made in the template file searchform-listing.php, so using a child theme is the preferable way to implement the change.

Create file searchform-listing.php in the root folder of the child theme.Add t…
Read more about Replace ClassiPress Location Search field with a custom field dropdown
  • 10