Skip Navigation

[Resolved] View – Prevent line break at the end of the loop

This thread is resolved. Here is a description of the problem and solution.

Problem:

Query "Exhibitors" posts, and order the result by taxonomy "Exhibitors-type", no line break between terms of taxonomy "Exhibitors-type".

Solution:

Views is using WordPress Class WP_Query to query posts, see WordPress document:

https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters

There isn't such a feature to order the result by taxonomy.

As a workaround, you can use a custom select field "Exhibitors-type" instead of taxonomy "Exhibitors-type"

Relevant Documentation:

https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters

This support ticket is created 5 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 8 replies, has 3 voices.

Last updated by philippeS-4 5 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1273545

I have created nested views Parent taxonomy (unformatted) and Child post (Bootstrap 4col) - This is working fine.

Every time the parent view change to another taxonomy, it starts on a new row. I would like the new taxonomy to follow in the next column instead of starting a new row?

This is out it looks now - I haven't applied any CSS yet so it is messy.
hidden link

What I would like to achieve
hidden link

Maybe I shouldn't use a taxonomy for the Sponsor type and just have a custom field?

#1273557

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

if you do not want to categorize the posts I do not know why you use the nested views?

Are you using taxonomy view to display only posts that belong to such taxonomy category? Can you please share the code you are using with both the views or access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1273569

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Again - I do not know why you use parent taxonomy view as you already display the taxonomy term attached to post in your child view using the shortcode [wpv-post-taxonomy type="exhibitor-type"].

What if you remove the parent view and change the taxonomy query filter to your child view to "Any of the following" and select the terms you wanted and display just child view?

#1273585

The issue i need to first sort by taxonomy slug and then post title. I believe this is not possible in a normal post view?

#1273649

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - you cannot combine both term and post sorting as both queries are different.

There is no way I can offer you due to how view loops are structured. Either you should follow the way I suggested you to go with one view or you need to keep the current structure.

#1273685

Ok I did as you suggested here is the result. hidden link

My issue is I want all the Platinum Sponsor first, then Gold, the Silver, then Exhibitors and then Media Partner (the taxonomy slug is build for this order type)

Hope this makes sense?

#1273693

Feel free to play around if you want to. This is a test site and I made a backup!
Thanks for your help

#1274191

Hello,

Minesh isn't available, I will take care this thread.

I assume you are going to query "Exhibitors" posts, and order the result by taxonomy "Exhibitors-type", no line break between terms of taxonomy "Exhibitors-type".

Views is using WordPress Class WP_Query to query posts, see WordPress document:
https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
There isn't such a feature to order the result by taxonomy.

As a workaround, you can use a custom select field "Exhibitors-type" instead of taxonomy "Exhibitors-type", then you will be able to setup a post view:
- Query "Exhibitors" post
- Order the result by custom field "Exhibitors-type"
- And display the result without line break.

#1274355

My issue is resolved now. Thank you!