• Resolved sites1545

    (@sites1545)


    Hello
    how change the word category in the listing page to some something diffrent ?

    Item Information
    Title *
    (Category)
    Select options …
    Gallery

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

    (@gwin)

    You can do that by adding following code to your theme functions.php file

    
    
    add_filter( "adverts_form_load", "change_category_label" );
    function change_category_label( $form ) {
      if( $form['name'] != "advert" ) {
        return $form;
      }
      foreach( $form["field"] as $key => $field ) {
        if( $field["name"] == "advert_category" ) {
            $form["field"][$key]["label"] = "Some other label";
        }
      }
      return $form;
    }
    
    Thread Starter sites1545

    (@sites1545)

    That worked perfect

    Is it possible to change the word title ?

    Thread Starter sites1545

    (@sites1545)

    That worked perfect

    Is it possible to change the word title ?

    Plugin Author Greg Winiarski

    (@gwin)

    Inside the code above additionally add

    
        if( $field["name"] == "post_title" ) {
            $form["field"][$key]["label"] = "Some other title";
        }
    
    Thread Starter sites1545

    (@sites1545)

    Hello

    added that to add to the top but stays that same .

    if( $field[“name”] == “post_title” ) {
    $form[“field”][$key][“label”] = “Some other title”;
    }

    add_filter( “adverts_form_load”, “change_category_label” );
    function change_category_label( $form ) {
    if( $form[‘name’] != “advert” ) {
    return $form;
    }
    foreach( $form[“field”] as $key => $field ) {
    if( $field[“name”] == “advert_category” ) {
    $form[“field”][$key][“label”] = “Some other label”;
    }
    }
    return $form;
    }

    Plugin Author Greg Winiarski

    (@gwin)

    It should be

    
    add_filter( "adverts_form_load", "change_category_label" );
    function change_category_label( $form ) {
      if( $form['name'] != "advert" ) {
        return $form;
      }
      foreach( $form["field"] as $key => $field ) {
        if( $field["name"] == "advert_category" ) {
            $form["field"][$key]["label"] = "Some other label";
        }
    
        if( $field["name"] == "post_title" ) {
            $form["field"][$key]["label"] = "Some other title";
        }
      }
      return $form;
    }
    
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Changing the word category’ is closed to new replies.