-
AuthorPosts
-
January 5, 2021 at 6:42 pm #1270449
Hi,
you once gave me this code to add a slogan & a subslogan into the headarea of my website:
(You cant see it live cause i removed it again)add_filter('avf_logo_subtext', 'kriesi_logo_addition'); function kriesi_logo_addition($sub) { $sub .= "<div id='headText'> <a href='https://www.maskenzauber.com'><h1>Venezianische<span> Masken</span></h1></a> <span id='subslogan'>Handgefertigt in Berlin</span> </div>"; $sub .= "<div id='headClaim'> <strong>Here comes</strong> another claim </div>"; return $sub; }
But this leads to a fatal error according W3C:
Element div not allowed as child of element span in this context. (Suppressing further errors from this subtree.)
From line 232, column 267; to line 232, column 285
‘subtext’><div id=’headText’>↩Contexts in which element div may be used:
Where flow content is expected.
As a child of a dl element.
Content model for element span:Followed by these errors:
Error: Start tag a seen but an element of the same type was already open.
From line 233, column 6; to line 233, column 39
xt’>↩ <h1>Ve
Error: End tag a violates nesting rules.
From line 233, column 6; to line 233, column 39
xt’>↩ <h1>Ve
Fatal Error: Cannot recover after last error. Any further errors will be ignored.
From line 233, column 6; to line 233, column 39
xt’>↩ <h1>Ve
Here is the complete output:
<div class='container av-logo-container'><div class='inner-container'><span class='logo'><a href='https://www.maskenzauber.com/'><img height="100" width="300" src='https://maskenzauber.com/graphic/logo.png' alt='Maskenzauber' title='' /><span class='subtext'><div id='headText'> <a href='https://www.maskenzauber.com'><h1>Venezianische<span> Masken</span></h1></a> <span id='subslogan'>Handgefertigt in Berlin</span> </div><div id='headClaim'> <strong>Here comes</strong> another claim. </div></span></a></span>
Maren
January 6, 2021 at 9:14 am #1270556Hi Maren,
Thanks for providing the code, the html code in the hook will be put inside a span tag.
Try to change div tags to span and just target it with css and set it to display: block.Best regards,
NikkoJanuary 9, 2021 at 10:51 pm #1271254This is respectless.
YOU mods gave me this wrong code and now you say “go help yourself”??????
I dont want to be “supported” by you anymore.
Please send @yigit.
ThanksJanuary 11, 2021 at 5:13 am #1271473Hi Maskenzauber,
Can you give us the thread where we have posted this solution?
Also, we are trying to help you by giving you the solution which is just changing the div to span, and since we don’t have access to your site, we just state the solution.Best regards,
NikkoJanuary 11, 2021 at 5:06 pm #1271645Hi @yigit, can you please help??
January 13, 2021 at 11:48 am #1272119Hi Maren,
Thanks for contacting us!
Please use the code as following
add_filter('avf_logo_subtext', 'kriesi_logo_addition'); function kriesi_logo_addition($sub) { $sub .= "<span id='headText'> <h1>Venezianische<span> Masken</span></h1> <span id='subslogan'>Handgefertigt in Berlin</span> </span>"; $sub .= "<span id='headClaim'> <strong>Here comes</strong> another claim </span>"; return $sub; }
I deleted the link from code because subtext is added inside logo link so second link in there breaks HTML and changed Div tags to Span tags as apparently div tags are not allowed inside span tags. I was not aware of that.
If you are going to need to add additional link in subtext, I would recommend using a widget in header (https://kriesi.at/documentation/enfold/header/#adding-a-header-widget-area) instead as that would not break existing logo link. If second link is not necessary for you, this version of code should work just fine :)
Best regards,
Yigit -
AuthorPosts
- You must be logged in to reply to this topic.