Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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

    #1270556

    Hi 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,
    Nikko

    #1271254

    This 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.
    Thanks

    #1271473

    Hi 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,
    Nikko

    #1271645

    Hi @yigit, can you please help??

    #1272119

    Hi 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.