Tag Order
-
Hey!
is it somehow possible to change the order of the tags shown underneath a project thumbnail? I looked up the version history of laytheme (see below) and it says it's possible, but I can't figure out how. When I add tags to a project, it would always get ordered alphabetically, no matter in what order I enter them.
The Changelog/Version History of Laytheme says:
3.9.1 - 19 September 2021
When editing Tags you can change their order to change the order of tags underneath Project Thumbnails -
Hello, I re-open this thread because I see tag order don't work for me.
I've got a lot of tags, and when I tried to re-order them (having numbers before words) it works only on certain number values, and not with others, even if in the tags page numbers appears as first.
Here a pic of how I sorted them, but still in this page they appears sometimes in the middle of 3 tags line https://landcho.eu/all-projects/
I used this code in custom head content:
<script defer>
if (window.location.pathname.includes("all-projects")) {
document.addEventListener("DOMContentLoaded", function () {
const thumbnails = document.querySelectorAll(".below-image");thumbnails.forEach(function (thumb) { const tags = thumb.querySelectorAll(".thumbnail-tags span"); if (!tags.length) return; const tagArray = Array.from(tags); // Ordina: numerici prima, poi alfabetici tagArray.sort((a, b) => { const aIsNumber = /^\d/.test(a.textContent.trim()); const bIsNumber = /^\d/.test(b.textContent.trim()); if (aIsNumber && !bIsNumber) return -1; if (!aIsNumber && bIsNumber) return 1; return a.textContent.localeCompare(b.textContent); }); const tagContainer = thumb.querySelector(".thumbnail-tags"); if (tagContainer) { tagContainer.innerHTML = ""; tagArray.forEach(tag => tagContainer.appendChild(tag)); } }); });
}
</script>but it works only when I refresh the page, not when I arrive there directly.
Any suggestions for how to fix it? @arminunruh maybe?Thanks!
Roberta
-
Can you please send:
- a link to this forum topic
- your website address
- /wp-admin/ username and password
to: info@laytheme.com
seems like u changed the password
i wanna see why this happens this shouldnt happen -
for javascript like that you need to wrap it in
window.laytheme.on("newpageshown", function(){
...
})
I also code custom websites or custom Lay features.
šæ Email me here: šæ
info@laytheme.com
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options ā Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it