How to add custom fields to Listings and Requests forms in HivePress?

Hi,

I’m using the HivePress (ExpertHive) theme and I’d like to better understand how to set up a customized submission form:

  1. How can I add my own fields to the Listing submission form and the Request submission form?
  2. Will these custom fields/attributes automatically appear in the published listing or request (e.g. in the details section)?
  3. How can I make sure that potential clients or visitors can see these attributes (for example on the listing page, in the listing card, or as filters in search)?

I’d really appreciate a step-by-step explanation — should this be done via HivePress → Attributes, or do I need to enable something additional for Listings and Requests?

Thanks a lot in advance for your help! :folded_hands:

Hey @Kamilos,

You’ve already pretty much worked it out, but instead of HivePress > Attributes, Go to Listings > Attributes and so on, vendors, users, etc all have their own sidebar menu item.

When you’re adding a new listing the Display section at the bottom is how the attribute will be shown in the front-end listings.

The first few sections relate to building the type of attribute field, (text, phone number, attachment, etc.)

If you’re creating an attribute with multiple checkboxes or options, save the page and refresh it. There will be a new button to click into where you can now add each available option.

You can also choose the settings related to filtering the options further after searching.

Play around with the different slot options in the displsy section (page primary, etc) to find the position you like most on a listing.

Page = individual listing pages
Block = individual card/widget/blocks

Oh! And, don’t forget to make the fields editable on the front end. I think that’s the first option on the page.

I hope this helps!

There’s also lots of documentation relating to HivePress. Have a look at the help section.

Cheers,
Chris

2 Likes

Hi,

I believe ChrisB answered all your questions, but if you have any more questions, please don’t hesitate to ask.

1 Like

Thank you for the advice :wink: Please let me know if it’s possible to remove fields in the administration panel (attached) or do I have to remove them using PHP?

Thank you

Hi @Kamilos,

Those fields are added by default, but like you mentioned can be removed with PHP snippets. If you search the forum for remove [field name] you’ll likely find examples of others who have done the same.

Here’s an example for the image field:

I hope this helps!

Cheers,
Chris :victory_hand:

1 Like

I added this code to /submit-listing/details/

Unfortunately, it doesn’t remove the fields. I wrote my own code and added it to code snippets. It did remove the fields, but when submitting the form, the message “Complete the price field” appeared.

Please share your code snippet and let me know which fields you would like to hide.

<?php
// Usunięcie wybranych pól z formularza dodawania ogłoszenia
add_filter( 'hivepress/v1/forms/listing_submit', function( $form ) {
    if ( ! empty( $form['fields'] ) && is_array( $form['fields'] ) ) {
        foreach ( ['images','title','price','location','tags','description'] as $key ) {
            unset( $form['fields'][ $key ] );
        }
    }
    return $form;
}, 9999 );

// (opcjonalnie) to samo dla edycji ogłoszenia
add_filter( 'hivepress/v1/forms/listing_update', function( $form ) {
    if ( ! empty( $form['fields'] ) && is_array( $form['fields'] ) ) {
        foreach ( ['images','title','price','location','tags','description'] as $key ) {
            unset( $form['fields'][ $key ] );
        }
    }
    return $form;
}, 9999 );

??
Hi,
I managed to solve this problem with this code:

To avoid starting a new thread, I have another question.

I’ve created attributes in /submit-request/details/, and now I’m wondering how to make some of these attributes visible in tiles on the order subpage?

What do the terms “main block,” “secondary block,” “triple block,” “main page,” “secondary page,” and “triple page” in the “areas” field mean and where do they point? I suspect this is where these options are set.

Thank you for your feedback

In HivePress there are display areas called Page and Block. The Page corresponds to the standalone page of a listing or vendor, while the Block corresponds to the preview of listings when you search for them.

For a Block, the primary area is where you can see the price in the demo. The secondary area is where the details are shown in two columns. The ternary area is located between the primary and secondary areas. For a Page, the areas are the same.

Hope this helps

Good morning,

Could you please explain exactly which section is responsible for displaying this?

Thank you in advance.

You can choose where each attribute is displayed by going to Attribute > Display Block.

Here is a visualization that shows exactly where each display area appears on the page and within blocks.