# Changing attributes order in add listing and listing edit page

**URL:** <https://community.hivepress.io/t/changing-attributes-order-in-add-listing-and-listing-edit-page/1338>\
**Category:** HivePress\
**Created:** [August 16, 2022, 9:48am UTC](https://community.hivepress.io/t/changing-attributes-order-in-add-listing-and-listing-edit-page/1338 "2022-08-16T09:48:50Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![projects\_getspace](https://community.hivepress.io/letter_avatar_proxy/v4/letter/p/47e85d/32.png) [@projects\_getspace](https://community.hivepress.io/u/projects_getspace)\
**Post date:** [August 16, 2022, 9:48am UTC](https://community.hivepress.io/t/changing-attributes-order-in-add-listing-and-listing-edit-page/1338/1 "2022-08-16T09:48:50Z")

</div>

Hello,  
Is it possible to change default attributes order in submit listing form? I would need to change description / youtube / spotify order.

---

<div class="post-metadata">

**Author:** ![yevhen](https://community.hivepress.io/user_avatar/community.hivepress.io/yevhen/32/23_2.png) [@yevhen](https://community.hivepress.io/u/yevhen)\
**Post date:** [August 16, 2022, 10:44am UTC](https://community.hivepress.io/t/changing-attributes-order-in-add-listing-and-listing-edit-page/1338/2 "2022-08-16T10:44:27Z")

</div>

Please try this PHP snippet to start. In this way, it is possible to change the order for other fields in the listing submit form

```auto
add_filter(
	'hivepress/v1/forms/listing_submit',
	function( $form ) {
		$form['fields']['description']['_order'] = 1;

		return $form;
	},
	1000
);

```

---

<div class="post-metadata">

**Author:** ![projects\_getspace](https://community.hivepress.io/letter_avatar_proxy/v4/letter/p/47e85d/32.png) [@projects\_getspace](https://community.hivepress.io/u/projects_getspace)\
**Post date:** [August 16, 2022, 11:21am UTC](https://community.hivepress.io/t/changing-attributes-order-in-add-listing-and-listing-edit-page/1338/3 "2022-08-16T11:21:51Z")

</div>

Hmm, i tried it, but it looks like that this snippet moves selected field to top and doesn’t look at the number that was inserted. For example I have 4 fields that have 1,2,3,4 order numbers and I insert 5 into description field, but the description field is still at the top, but it should be below the 4th attribute.

$form[‘fields’][‘description’][’\_order’] = 5;

---

<div class="post-metadata">

**Author:** ![yevhen](https://community.hivepress.io/user_avatar/community.hivepress.io/yevhen/32/23_2.png) [@yevhen](https://community.hivepress.io/u/yevhen)\
**Post date:** [August 17, 2022, 10:50am UTC](https://community.hivepress.io/t/changing-attributes-order-in-add-listing-and-listing-edit-page/1338/5 "2022-08-17T10:50:21Z")

</div>

Please make sure that you have set the correct field names for other fields to change their order. For example, it will be `$form['fields']['title']['_order']` for field Title. If you’re familiar with PHP basics please try to output the fields this way:

```auto
add_filter(
	'hivepress/v1/forms/listing_submit',
	function( $form ) {
        var_dump($form['fields']);
		die();
		return $form;
	},
	1000
);

```

This will output all the fields keys/field names on the front-end, so you’ll be able to use them with a sample snippet above to re-order any fields

Also, you can share your code snippet here if the issue persists

---

<div class="post-metadata">

**Author:** ![Adams](https://community.hivepress.io/user_avatar/community.hivepress.io/adams/32/1338_2.png) [@Adams](https://community.hivepress.io/u/Adams)\
**Post date:** [September 13, 2022, 1:08am UTC](https://community.hivepress.io/t/changing-attributes-order-in-add-listing-and-listing-edit-page/1338/6 "2022-09-13T01:08:34Z")

</div>

It works great in listing submit form. but how to do the same for listing edit page?

```auto
add_filter(
'hivepress/v1/forms/listing_submit',
function( $form ) {
$form['fields']['title']['_order'] = 2;
$form['fields']['images']['_order'] = 3;
$form['fields']['description']['_order'] = 4; 

return $form;
},
1000
);

```

---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [September 13, 2022, 6:44am UTC](https://community.hivepress.io/t/changing-attributes-order-in-add-listing-and-listing-edit-page/1338/7 "2022-09-13T06:44:51Z")

</div>

Please change `listing_submit` to `listing_update`

---

<div class="post-metadata">

**Author:** ![Adams](https://community.hivepress.io/user_avatar/community.hivepress.io/adams/32/1338_2.png) [@Adams](https://community.hivepress.io/u/Adams)\
**Post date:** [September 13, 2022, 7:58am UTC](https://community.hivepress.io/t/changing-attributes-order-in-add-listing-and-listing-edit-page/1338/8 "2022-09-13T07:58:52Z")

</div>

Thanks, I got it. And how about front end. Would you please write a snippet code sample to reorder images 1, title 2, description 3

```auto
add_filter(
	'hivepress/v1/forms/listing_submit',
	function( $form ) {
        var_dump($form['fields']);
		die();
		return $form;
	},
	1000
);

```

---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [September 14, 2022, 8:15am UTC](https://community.hivepress.io/t/changing-attributes-order-in-add-listing-and-listing-edit-page/1338/9 "2022-09-14T08:15:29Z")

</div>

Please try the same snippet but for the `listing_update` form:

```auto
add_filter(
'hivepress/v1/forms/listing_update',
function( $form ) {
$form['fields']['title']['_order'] = 2;
$form['fields']['images']['_order'] = 3;
$form['fields']['description']['_order'] = 4; 

return $form;
},
1000
);

```

Change 2, 3, 4 numbers to adjust the order. This will also affect the `listing_submit` form if there’s no specific snippet for it since this form inherits the `listing_update` one.

---

<div class="post-metadata">

**Author:** ![Adams](https://community.hivepress.io/user_avatar/community.hivepress.io/adams/32/1338_2.png) [@Adams](https://community.hivepress.io/u/Adams)\
**Post date:** [September 14, 2022, 2:41pm UTC](https://community.hivepress.io/t/changing-attributes-order-in-add-listing-and-listing-edit-page/1338/10 "2022-09-14T14:41:37Z")

</div>

Thanks it works great!

---

<div class="post-metadata">

**Author:** ![system](https://community.hivepress.io/user_avatar/community.hivepress.io/system/32/13990_2.png) [@system](https://community.hivepress.io/u/system)\
**Post date:** [October 14, 2022, 2:41pm UTC](https://community.hivepress.io/t/changing-attributes-order-in-add-listing-and-listing-edit-page/1338/11 "2022-10-14T14:41:40Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![frappa](https://community.hivepress.io/user_avatar/community.hivepress.io/frappa/32/10203_2.png) [@frappa](https://community.hivepress.io/u/frappa)\
**Post date:** [September 29, 2024, 7:49pm UTC](https://community.hivepress.io/t/changing-attributes-order-in-add-listing-and-listing-edit-page/1338/12 "2024-09-29T19:49:53Z")

</div>

Hello everyone. I really want to switch around the fields in the form to submit the listing, to improve the ux. I have not understood how to do it following the guides. It seems to be an array coming from somewhere. Can anyone help me with that? Thanks

---

<div class="post-metadata">

**Author:** ![andrii](https://community.hivepress.io/user_avatar/community.hivepress.io/andrii/32/2951_2.png) [@andrii](https://community.hivepress.io/u/andrii)\
**Post date:** [September 30, 2024, 9:20am UTC](https://community.hivepress.io/t/changing-attributes-order-in-add-listing-and-listing-edit-page/1338/13 "2024-09-30T09:20:09Z")

</div>

Hi,

Please check this topic.
