Hi,
yes, it is possible, you can remove the Price field from the [adverts_add] form either using the Custom Fields extension or by adding the code below in your theme functions.php file (or even better create a new blank plugin https://wpadverts.com/blog/how-to-use-code-snippets-in-wordpress/ and paste the below code there)
add_filter( "adverts_form_load", function( $form ) {
if( $form["name"] != "advert" ) {
return $form;
}
foreach( $form["field"] as $k => $f ) {
if( $f["name"] == "adverts_price" ) {
unset( $form["field"][$k] );
}
}
return $form;
} );
If the price field will not be in the publication form then the users will not be able to fill it, if the users are not able to fill the price field then it will not show in the list or details pages.
Thread Starter
sai122
(@sai122)
@gwin Hello, I have tried everything that it says and it does not work, uploading the code directly in the functions.php file the web stops working, if I add the extension from the link that told me, on the web an image appears with an error and it continues the field appearing on the form.
-
This reply was modified 4 years, 8 months ago by
sai122.
I am testing the code and it seems to be working fine for me, so the code itself seems to be fine.
Anyway, i wrapped it into a plugin, so the only thing you need to do now in order to remove the price is to download the plugin here https://www.dropbox.com/s/ihkuflj9e6l4pu0/remove-the-price-field.zip?dl=0 and install and activate it from wp-admin / Plugins / Add New / Upload panel like any other WP plugin.