Replace the Price with Sold tag for sold ClassiPress Ads

Currently, ClassiPress theme displays a "Sold" warning on the single ad page. But it's not reflected on the ad in loops and doesn't show any warning or sold tag.

Following code snippet replaces the Price with Sold tag for ads marked sold.

ClassiPress Sold Tag example

You can add it in a custom plugin or child theme functions.php file or use Code Snippets plugin (more details in the instruction).

/** * Adds the ad price field in the loop before the ad title. * * For sold ads replaces price with SOLD tag. * * @return void */ function arthemes_ad_loop_price() { global $post; if ( APP_POST_TYPE !== $post->post_type ) { return; } // Display Price tag for non-sold ads. if ( 'yes' !== $post->cp_ad_sold ) { cp_ad_loop_price(); return; } ?> <div class="price-wrap sold-wrap"> <span class="tag-head"><span class="post-price"><?php esc_html_e( 'Sold', APP_TD ); ?></span></span> </div> <?php } remove_action( '…
Read more about Replace the Price with Sold tag for sold ClassiPress Ads
  • 0

Disable Favorite Listings in Vantage theme

Favorite listings is the build-in feature in Vantage theme. But for some sites it is not needed.

Following PHP code snippet will disable Favorite Listings. You can add in a custom plugin or child theme functions.php file. Alternatively, Code Snippets plugin can be used (more details in the instruction).

add_filter( 'va_fave_listing_link', '__return_empty_string' ); add_filter( 'va_header_menu_primary_items_user', function( $fields ) { unset( $fields['favorites'] ); return $fields; } );

Read more about Disable Favorite Listings in Vantage theme
  • 0

Customize AppThemes Importer

The AppThemes themes provided with a built-in listing importer, which allows importing new listings using CSV spreadsheets.

Currently, following themes support the AppThemes Importer feature: ClassiPress, Vantage, Clipper and JobRoller.

Listings can be imported with title, description, excerpt, status, author, date, slug, attachments, Geo data (if theme supports), custom fields, taxonomy terms and even taxonomy meta.

Each theme configures the Importer with a list of fields it should process. Site owners can check out this list by downloading sample CSV file and add their listings for import by adding data in appropriate spreadsheet columns.

The only issue is that site owners can't just add few more columns in a listings table and expect that the Importer will add this data to new listings.

The Importer doesn't understand where to add this new data, such as custom fields, taxonomy terms or post core fields.

Hooks Inven…
Read more about Customize AppThemes Importer
  • 0

Toggle fields group on the ClassiPress listing form

This mod can be useful if your ClassiPress listing form has too many fields and you want to toggle fields group visibility via button or a link.

Toggle visibility for a fields group

Especially, this important for mobile devices, where the long forms look complex and boring for your ad authors.

There are only two steps to implement this mod on your ClassiPress site.

1. Select which fields you want to toggle.

Use ClassiPress form builder and move all these fields below the listing Description field. The Description field will be the last field to be shown on page load. All fields below will be hidden until user clicked the Toggle link.

2. Add JavaScript snippet on your page.

Add the following code in your theme JavaScript scripts file.

jQuery( function( $ ) { $( 'form.form_step #list_post_content' ).each( function() { var collapsed = $( this ).nextUntil( '.ad-details-images-sep', '.form-field' ); if ( collapsed.le…
Read more about Toggle fields group on the ClassiPress listing form
  • 0

Customize Category Menu for the Vantage theme

The Vantage theme allows displaying category mega menu in the navigation bar and on the dedicated Categories page.

Vantage Category Menu

Currently, there are no options for customization Category menu, but fortunately it has all necessary hooks and filter for that.

The filter "va_listing_categories_{$location}_args" allows changing parameters and alternate category menu for navigation and categories page separately. Dynamic part {$location} determines the location of the menu to apply changes for:

va_listing_categories_dir_args - applies changes to menu on the Categories page.va_listing_categories_menu_args - applies changes to the navigation mega menu. Filter 'va_listing_categories_{$location}_args' Basic parameters 'menu_cols' - (int) Columns number. Default 2 for page or 3 for navigation menu.'menu_depth' - (int) Number of sub categories levels. Default 3.'menu_sub_num' - (int) Max number of subcategories. Default 3.'…
Read more about Customize Category Menu for the Vantage theme
  • 0

Custom code and styles for CP Addons plugin for ClassiPress

The main idea behind the CP Addons plugin is to highlight some ClassiPress ads over others. Ad owners gladly pay for it and your site makes a profit. Below you will find few insights on how to style featured ads with samples.

Featured Ad Ribbons

A Ribbon is the most popular way to highlight featured ads. Usually, this is colored band with the text adjacent to a featured image or ad block in general.

Different ClassiPress versions and child themes have different styles, what requires different ways to add ribbons. Here we provide some samples for most frequent cases.

Featured Ads ribbon for ClassiPost v1.3.8

ClassiPost is one of the most popular ClassiPress v3 child themes, whose users done a lot of requests for custom CP Addons styles.

How it looks Featured Ads ribbon on the ClassiPost ad Code

Add the CSS code to the Additional CSS section of your theme Customizer:

.featured-ad_listing-vip .image-item { overf…
Read more about Custom code and styles for CP Addons plugin for ClassiPress
  • 0

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
  • 32

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