• Resolved energizant

    (@energizant)


    Hello, my site uses free ads, and I don’t need to add a price, I want to delete the price from the add ad page, how can I do this, can someone help me, thank you!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,

    you can remove the Price field from the publish form by adding the code below in your theme functions.php file, when the price will not be filled it will also not show on the ads list and details pages.

    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;
    }
    Thread Starter energizant

    (@energizant)

    Wow, everything worked perfectly from the first time after adding the code, thank you from the bottom of my heart

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.