wwccscorer
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Filters, metadata and gutenbergAfter more research, the following added at the beginning of the filter gives me the 2nd option from above (no filtering at all in the editor)
if(strstr($_SERVER['REQUEST_URI'], 'wp-admin/post-new.php') ||
strstr($_SERVER['REQUEST_URI'], 'wp-admin/post.php') ||
strstr($_SERVER['REQUEST_URI'], '/wp-json/wp/v2/')){
return $metadata;
}but this seems a bit of a hack. If anyone knows a better way to do this, I’d be grateful to hear from you.
Forum: Fixing WordPress
In reply to: Dark Mode, a question of styleThe site is live now – http://sssccrrl.co.uk/ although the homepage is implemented slightly differently from the rest of the site to allow for the cover video so you might prefer to look at one of the more normal pages eg http://sssccrrl.co.uk/enter/
The html and js for the toggle is in custom html blocks so you can view it from the page source.
The (S)CSS has some slightly hacky parts to allow for :-
- Dark mode in Events Manager which does not deal well with it (the “Calendar” and “Circuits” pages)
- Striped table with background colours applied which need manual allocation of text colours (eg http://sssccrrl.co.uk/2025-round-7/)
- Sticky header rows and columns, also on the results tables
- The SVG overlay on the header image slider
Unfortunately, the author of the helpful advice I referred to seems to have chosen to remove their reply from this topic so it is not possible to refer back to it but I will place on record (again) my thanks for the help they gave me in taking these tentative steps in dark mode implementation.
- This reply was modified 2 months, 3 weeks ago by wwccscorer.
Many thanks for the warning. I’ve updated the plugin and made the change.
Regards
Forum: Fixing WordPress
In reply to: Dark Mode, a question of styleThanks to the advice received, I have created theme.json in my child theme containing
"settings": {
"color": {
"palette": [
{
"color": "light-dark(#ffffff, #202124)",
"name": "Base",
"slug": "base"
},
etc...My JS reads and changes the color-scheme in the document root to utilise the values in theme.json –
docroot = document.querySelector(':root');
docroot.style.setProperty("color-scheme", "dark");
OR
docroot.style.setProperty("color-scheme", "light");and also sets a class on the document body to allow the values in style.css, which I haven’t yet worked out how to add to theme.json, to be used
document.body.classList.toggle("dark-theme");
AND
document.body.classList.toggle("light-theme");This is probably still not the best way to do this but I feel it’s a step in the right direction.
Many thanks for the advice and assistance.
Forum: Fixing WordPress
In reply to: Dark Mode, a question of styleI forgot to say that this is already in a child theme (of twentytwentythree). The small amount of code required doesn’t really need the effort of creating a new block for it.
I’m not worried about it going wrong but the general direction of WP development is to remove theme information from css and have it in json format instead. It seems wrong to reverse that in order to do what I have done. In particular, if the parent theme is improved, there is no quick way to reflect that improvement in my child theme except by duplicating the theme.json information in my css.
I just wondered if there was a more canonical and correct way to do what I am attempting.
Never mind – I worked it out – functions.php? If this is not the right place, please let me know but it seems to work.
Thank you for your help, and sorry for not spotting the original thread and taking up your time.
Sorry to be a bit dense – where do I put that code?
Also, I’m a little puzzled as this was working until I upgraded from 6.4 to 7.0.5?
I have temporarily enabled frontend editing – I can add event categories using this but it converts my event to classic blocks which is a bit of a nuisance.
I still cannot add them using the back end (gutenberg) editor.
I think we’re talking about the same thing. I cannot see the event category selection panel in the right hand side of the editor, only the wordpress post categories. I would normally expect to see the event catgories below them.
Forum: Fixing WordPress
In reply to: Block Variations & PatternsFrom https://make.wordpress.org/core/2023/07/14/layout-updates-in-the-editor-for-wordpress-6-3/ :-
Previously, the Post Template block had custom layout styles that allowed for either a “list” or a “grid” (implemented behind the scenes with CSS flex) layout, with controls living in its parent Query block.
For 6.3, layout and block spacing support have been added to Post Template, and its controls now live in the Post Template toolbar. There is still a choice of “list” and “grid” styles, but “grid” is now implemented with the grid layout type.
I have now wrapped my query data in a post template block and can choose between list and grid again.
Forum: Plugins
In reply to: [Extensions for Leaflet Map] Elevation Y AxisThank you for the “!detached” information. It explains why I couldn’t make the width option work on my test site. It’s not what I first thought but it looks better than I expected.
It would be nice if you could add it but only if it’s not too much trouble for you.
Thanks again,
Simon
Forum: Plugins
In reply to: [Extensions for Leaflet Map] Elevation Y AxisI am sorry to start asking for yet more but would it be possible to add the width parameter to the elevation profile (height is already there) so that I can make profiles which are the same width as the wide maps I can create?
Thanks for your time in looking at this,
Kind Regards,
Simon
Forum: Plugins
In reply to: [Extensions for Leaflet Map] Elevation Y AxisThanks for your rapid and positive response.
Cheers,
Simon