I have created a child theme and that went well. I have altered style and theme.json and I have added functions and screenshot. And now I am confused… very:
I have this in index template:
<!-- wp:template-part {"slug":"footer","area":"footer"} /-->
and this in original TT4 index:
<!-- wp:template-part {"slug":"footer","area":"footer","tagName":"footer"} /-->
Why the difference? Where can I find slug to my footer? that is a template part and why is it not updated here, since I create a child from TT4 where this was correct? Why can I not see it when I see it in editor?
My current theme.json child is like so:
{
"$schema": "https://schemas.wp.org/wp/6.6/theme.json",
"version": 3,
"patterns": [],
"settings": {
"color": {
"palette": [
{
"name": "Black",
"slug": "black",
"color": "#000000"
},
{
"name": "White",
"slug": "white",
"color": "#ffffff"
},
{
"name": "Draupnir 8",
"slug": "draupnir-8",
"color": "#171717"
},
{
"name": "Draupnir 9",
"slug": "draupnir-9",
"color": "#ae1100"
}
]
}
}
"styles": {
"blocks": {
"core/button": {
"variations": {
"outline": {
"spacing": {
"padding": {
"bottom": "calc(0.6rem - 1px)",
"left": "calc(1rem - 1px)",
"right": "calc(1rem - 1px)",
"top": "calc(0.6rem - 1px)"
}
},
"border": {
"width": "1px"
}
}
}
},
"core/buttons": {
"spacing": {
"blockGap": "0.7rem"
}
},
"core/search": {
"css": "& .wp-block-search__input{border-radius:.33rem}",
"typography": {
"fontSize": "var(--wp--preset--font-size--small)"
},
"elements": {
"button": {
"border": {
"radius": { "ref": "styles.elements.button.border.radius" }
}
}
}
},
"color": {},
"elements": {
"button": {
":active": {
"color": {
"background": "var(--wp--preset--color--contrast)",
"text": "var(--wp--preset--color--base)"
}
},
":focus": {
"color": {
"background": "var(--wp--preset--color--contrast-2)",
"text": "var(--wp--preset--color--base)"
},
"outline": {
"color": "var(--wp--preset--color--contrast)",
"offset": "2px"
},
"border": {
"color": "var(--wp--preset--color--contrast-2)"
}
},
":hover": {
"color": {
"background": "var(--wp--preset--color--contrast-2)",
"text": "var(--wp--preset--color--base)"
},
"border": {
"color": "var(--wp--preset--color--contrast-2)"
}
},
"border": {
"radius": ".33rem",
"color": "var(--wp--preset--color--contrast)"
},
"color": {
"background": "var(--wp--preset--color--contrast)",
"text": "var(--wp--preset--color--base)"
},
"spacing": {
"padding": {
"bottom": "0.6rem",
"left": "1rem",
"right": "1rem",
"top": "0.6rem"
}
},
"typography": {
"fontSize": "var(--wp--preset--font-size--small)",
"fontStyle": "normal",
"fontWeight": "500"
}
},
},
},
"templateParts": [],
"customTemplates": []
}
Functions:
I am adding this to my functions cause I read in manuals I must. Why does WP themes not handle this default and is code correct?
/**
* Theme WordPress default does not enque the mother theme, when creating a child,
* hence, we call both the child as well as the mother themes
*/
add_action( 'wp_enqueue_scripts', 'draupnir_9_enqueue_styles' );
function draupnir_9_enqueue_styles() {
wp_enqueue_style(
'draupnir-9-parent-style',
get_parent_theme_file_uri( 'style.css' )
);
}
Thx – I need help, please
]]>I have setup a child theme for my TT4 install.
add_action( 'wp_enqueue_scripts', 'draupnir_enqueue_styles' );
function draupnir_enqueue_styles() {
wp_enqueue_style(
'draupnir-parent-style',
get_parent_theme_file_uri( 'style.css' )
);
}
thx
First of all, thank you so much for giving this brilliant theme away for free.
Now… I have installed both the main BOYO theme and the Child theme, which I have installed. But I was wondering which file do I need to alter in the Child theme, to show Google font Alice?
Peace be with you.
Mike.
You can learn more about child themes here.
HOW TO INSTALL
MonoWP Child Theme can be installed normally like any other third-party theme:
CUSTOMISATIONS
You have the option to overwrite any template, part, or pattern that exists in MonoWP by adding a file of the same name in MonoWP Child Theme (patterns must also have the same registered?slug?field). Of course, you can also add brand new templates, parts, and patterns to MonoWP Child Theme, even if they don’t exist in MonoWP.
You can also add your own custom code to theme.json
, style.css
and functions.php
files, by going to Tools →?Theme File Editor.
I am using PHP 5.6.36 with WP 6.2.4
Thanks!
]]>I’m reaching out to report an issue I encountered after performing an update on my WordPress website. Specifically, I am unable to add new categories or tags within my child theme.
The problem occurs when attempting to add a new category or tag. After clicking the “Add New” button, the spinner icon appears and continues spinning indefinitely. However, upon refreshing the page, I can see that the item has indeed been added successfully.
It’s worth noting that when I switch to the parent theme, this issue doesn’t occur, and I can add categories and tags without any problems. This suggests that the problem may be related to the child theme itself.
Thank you for your prompt attention to this matter. I look forward to your prompt response and resolution.
]]>Thank you for any clarification.
]]>