Skip Navigation

[Resolved] Order navigation icons for subpages

This support ticket is created 3 years, 2 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: Africa/Casablanca (GMT+01:00)

This topic contains 4 replies, has 2 voices.

Last updated by adriS 3 years, 2 months ago.

Assisted by: Jamal.

Author
Posts
#2180111

Thank you Jamal, my gut says redirect to. So I will redirect.

Regarding the Icon Navigation bar. Can a function be written so that each icon is linked to the specific order related to the parent page? And that it can direct what the parent page is?

#2180115

Well, these are two questions to find solutions for. The first is the order. The second is the image.

Personally, I would build a view that queries pages that are children of the current page. The view will be sorted by page menu order. You can set it per page by activating the page attributes. Check the first section of this article hidden link

However, the icon is a bit hard. Either store the icon on each of the pages in a custom field. Or add the images to your theme and build a dynamic URL to them. This dynamic URL needs to rely on a custom field, a custom taxonomy, or the index inside the loop. Something like:

<img src="<em><u>hidden link</u></em>;.png">

The shortcode can be a Types shortcode to get a custom field or a custom taxonomy value(info, stay, food-dring, see-do, events). Or the index inside the loop(0, 1, 2, 3, 4, 5).

Does it make sense?

#2180119
Screenshot (628).png

Yes, the pages is always in same order:
Town = Parent Page - 1ste icon
Stay = Child order 1 - icon 2
Food and drink = Child order 2 - Icon 3
See and do = Child order 3 - Icon 4
Event = Child order 4 - Icon 5

So my thinking is, it will first have to "read" what is the parent page and allocate the parent page link to icon 1 and then automatically assign the created links to related icons.

Just to clarify something - That is actually images in a grid displayed. IN the image example Aberdeen is the town: hidden link

#2180151

I see. In this case, the first icon(image, and link) needs to be out of the view. Before the view. Then, the view will query the child pages in order.
If you want to rely on the index inside the loop. You will need to have:
- Town: a separate image. And you will hard code it.
- Stay = Child order 1 - icon 0
- Food and drink = Child order 2 - Icon 1
- See and do = Child order 3 - Icon 2
- Event = Child order 4 - Icon 3

The view needs to add a query filter on post_parent equals to the page where this view is shown. And should have sorting order on the menu_order custom field.

I hope this answers your question. Let me know if I missed something.

#2180667

My issue is resolved now. Thank you!