silvercarpet
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: I need a Todo list, but can’t find a solutionI’ve had success with the to-di list provided by Md Abdullah Al Fahad, but I’m having trouble getting more than one list to work, even if they’re on different pages of my site.
I’ve changed the name of the list in the first line of code so they say
<ul id="shopping-list">and then
<ul id="shopping-list2">and also changed the code on in the <script> section to
const list = document.getElementById('shopping-list');and
const list = document.getElementById('shopping-list2');but the lists all mix together. If I cross something out on shopping-list it also gets crossed out on shopping-list2.
Is there a simple way I can just change something in the code to allow multiple lists on the same page?
I used the code below by Md Abdullah Al Fahad but it doesn’t work at. Nothing gets crossed out on either list.
<ul class="shopping-list">
<li>Option One</li>
<li>Option Two</li>
<li>Option Three</li>
<li>Option Four</li>
</ul>
<ul class="shopping-list">
<li>Second List Option One</li>
<li>Second List Option Two</li>
<li>Second List Option Three</li>
</ul>
<script>
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.shopping-list').forEach((list, listIndex) => {
const storageKey =checkedItems_${listIndex};
const savedState = JSON.parse(localStorage.getItem(storageKey) || '{}');
list.querySelectorAll('li').forEach((item, itemIndex) => {
// Restore saved state
if (savedState[itemIndex]) {
item.style.textDecoration = 'line-through';
}
// Handle clicks
item.addEventListener('click', () => {
const isChecked = item.style.textDecoration === 'line-through';
item.style.textDecoration = isChecked ? 'none' : 'line-through';
savedState[itemIndex] = !isChecked;
localStorage.setItem(storageKey, JSON.stringify(savedState));
});
});
});
});
</script>
<style>
.shopping-list li {
cursor: pointer;
transition: 0.2s;
}
.shopping-list li:hover {
color: #0073aa;
}
</style>Forum: Fixing WordPress
In reply to: I need a Todo list, but can’t find a solutionThank you so much @mabfahad
I put that code into a Custom HTML block and it worked perfectly first time! Foy anyone else who reads this, you just change the items listed at the top to whatever you want and it works exactly as I wanted.
I needed more than one list on the page, so I used the same code but changed the name of the second list on the first line as shown below. Without this, neither list worked.
<ul id="shopping-list2">And also changed line 10 to
const list = document.getElementById('shopping-list2');I’m so pleased I have this answer, and if anyone from WordPress could make this into a Gutenberg block, I’m sure people would use it.
Many thanks to @jasvirsaini too. I had thought of using forms, but couldn’t find one that saved progress. Gravity Forms looks interesting, so I’ll be taking a look into that as well.
- This reply was modified 7 months ago by silvercarpet.
Final update, it’s now working fine with 6.1.1 installed 😀
I found it just after posting this!
You have to click on “Quick edit” in the default menu row and then the option is on the right.
I found out that version 6.1.1 is coming out on November 15th so everything should be fine after that 😀
https://poststatus.com/wordpress-6-1-1-fse-%E2%86%92-site-editor-twenty-twenty-three/
That’s great news 😀
Thanks for all the work you do in bringing us Responsive menu and making our websites better.
- This reply was modified 3 years, 6 months ago by silvercarpet.
- This reply was modified 3 years, 6 months ago by silvercarpet.
I’m having the same issue with my site https://www.1stdrive.com/
It was working fine until the latest WordPress update of 6.1 and now the submenus won’t open. For example, if you select “Instructors” in the menu on a mobile, the submenu that comes up should lead to other menus from “New driving instructors” and “Standards check” but although the text shows, the menus don’t 🙁
I really hope this is fixed soon in an update as you mention above because I love Responsive menu but it’s not very responsive at the moment 😀
Just adding his so people know it’s not just their site and I thought it might help you fix it.
Forum: Fixing WordPress
In reply to: Moving WP from a subfolder to root but…And after just updating a cache plugin to my site made by my hosts Lazy Loading now works again!
- This reply was modified 5 years, 2 months ago by silvercarpet. Reason: typo
I get this issue if I embed a video while it’s still listed as private and then make it public.
The share link usually works fine but only if the video is public when you first embed the share link. No amount of browser refreshing, purging or cache clearing will ever make the video work on my page if I embed it when the video is private and then later make it public. If this happens then the solution is to paste the URL starting https://www.youtube.com/ and then it works.
I just wait until the video is public before ever embedding it and it saves all this hassle!
Forum: Themes and Templates
In reply to: Centre my site title and descriptionFixed.
Forum: Fixing WordPress
In reply to: Mobile menu only works after you refresh the pageI fixed it. I just turned off “Defer Render-blocking JS” which I’d turned on to speed the site up but I’d rather have the menu working!
Forum: Fixing WordPress
In reply to: Clicking icon links does nothing on my siteThanks, I tried all those things but still the same 🙁
Forum: Fixing WordPress
In reply to: Open menus without having to click on arrowThanks for that. If the arrows were easier to tap that would be easier yes, ideally I want to make the whole text tappable but anything to make it easier is good.
The arrows seem a little too close to the text so I could just put a space at the end of each word I suppose.
Forum: Fixing WordPress
In reply to: Image Alt tags have all just gone missing but they’re not?It’s all working fine now, it’s totally a problem at their end.
Forum: Fixing WordPress
In reply to: Image Alt tags have all just gone missing but they’re not?Thanks Samuel, that’s what I saw. I did have Alt tags in my image but they were after the lazy load version of the image was being loaded which didn’t have alt tags.