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

ClassiPress SEO Test

ClassiPress SEO test can show how upgrade of ClassiPress v3 to v4 can change the site search ranking results and give ideas for further structural improvements.

Below I'll explain how I did the tests, results and fixes.

Prepare Test I've created a new test site on a public serverInstalled vanilla ClassiPress 3.6.4Populated it with default content, 30 ad listings with images, categories and tags.Created a free account on and started crawling. Test steps Scan vanilla ClassiPress 3.6.4Update to ClassiPress 4.1.5 and repeat the scan.Research and fix determined errors, update ClassiPress files and repeat the scan.Merge working branch with the latest master (4.2.0) branch and repeat the scan. This step needs to find any issues that may appear between actual 4.1.5 and upcoming 4.2.0 versions.Repeat test with 4.2.0 version just to confirm results. ClassiPress SEO Test results

Below you can see the test result…

Read more about ClassiPress SEO Test
  • 0

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

Easy way to add custom PHP code on your WordPress site

A short instruction on how to Use Code Snippets plugin to add custom PHP code snippets on your WordPress site without files modifications.

We highly not recommend modifying WordPress themes and plugins!

A next software update will wipe out all the modifications from the code, so you will be forced to restore them each time.

The most obvious way is to create a child theme or custom plugin for all your code mods and snippets. But it requires you have some knowledge in coding. And if you are not skilled enough or don't want to hire a specialist for a 1-minute job, so try following.

There is an easy way to add some code on your site though the admin dashboard - using the Code Snippets plugin.

It allows you to create separated PHP code blocks (snippets) like you create new posts. You can disable or enable each snippet whenever it needs.

So, whenever you need to create a new custom PHP code snippet, you can do the follo…

Read more about Easy way to add custom PHP code on your WordPress site
  • 1

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

Compare files and folders

A short tech tip on how to compare files and folders using diff and merge software such as Meld. The basic Meld usage and features.

Sometimes, you want to compare files in two directories find the difference.

For example, when you update software on your site, would be good to know which files updated and how the changes may affect your installation. Or maybe you've (or your developer) changed some files on your site and forget where the changes were made.

Obviously, you won't check each file line by line. You certainly need a tool, which can find all differences and give you visual report.

One of such tools is the Meld. It's free, open source and available for Linux, Windows and OS X users.

Meld helps you compare files and directories in two- and even three-way overview. You also can manage files under version control, such as Git or Subversion.


Example below shows how looks comparison of the ClassiPress versions …

Read more about Compare files and folders
  • 0