Hi,
1. you can delete the price field by adding the code below in your theme functions.php file
add_filter( "adverts_form_load", "remove_price_field" );
function remove_price_field( $form ) {
if( $form['name'] != "advert" ) {
return $form;
}
foreach( $form["field"] as $key => $field ) {
if( $field["name"] == "adverts_price" ) {
unset( $form["field"][$key] );
}
}
return $form;
}
2. To add a custom field you would need to use the Custom Fields API https://wpadverts.com/documentation/custom-fields/
Note, that both removing the location and adding additional custom fields you can do using the Custom Fields extension https://wpadverts.com/extensions/custom-fields/
Thanks for your input Greg, however, I tried the code for removing the price field in wp adverts php 8 different ways with the code provided, and tried adjusting the admin options php of wp adverts, and removing the price code from line of code as well, and wp wouldn’t allow any of it. This is definitely a wp adverts plug-in feature issue, and not a wp issue. Does anyone working on the wp adverts have a possible solution? It can’t just be me trying to offer a free classified service.
Where exactly are you pasting this code? I am trying it just now and it seems to be working fine for me, the code itself i copied from another thread where a user wanted to remove a price field and it worked for him as well, so if the coded is placed in a proper place it should be working fine.
Additionally, do you have some caching plugin installed on site? If you do then please try disabling it and see if this helps.
One last note the code i pasted will remove the price field from the [adverts_add] form, it will not hide the red price box on [adverts_list] or Advert details pages if the Advert has a price already set.
I tried pasting the code at the bottom of wpadverts.php plugin files starting at line 539. The response I receive is; “Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.”
It doesn’t seem like an incompatibility plugin error.
It looks like WordPress will just not allow you to add this code from wp-admin / Plugins / Editor, you will need to login to your site via FTP and add it directly into the file.
Note the error does not say there is problem with the code snippet you are saving, most likely even if you add in function.php a line like $x = 1; it will not allow you to save.
BTW. I assume you are adding the code before the last ?> if there is ?> at the end of file at all.