Tagged: Sektion h1
-
AuthorPosts
-
November 6, 2023 at 3:46 pm #1424796
Hallo
folgendes Problem, ich habe eine Farb Sektion mit einem Container, in dem ein Text-Block ist, mit einem Code für ein NexForms Button für ein Formular.
SEO Tools melden, dass ich auf der Seite mehre h1 Überschriften benutze. Im Text-Block steht[NEXForms id=”1″ open_trigger=”popup” type=”button” text=”Angebot für eine PV-Anlage (klicken Sie hier)” button_color=”btn-primary” width=”80″ height=”80″ background=”use-form-background” open_animation=”fadeInDown” close_animation=”fadeOutUp”]
Im Quellcode der Seite wird aber das angezeigt
<h1 class=”the_input_element” data-math-equation=”” data-original-math-equation=”” data-decimal-places=”0″>Angebot für eine PV-Anlage</h1>
Wo kommt das her und wie kann ich das entfernen? Danke für die Hilfe
VG Highlanderr
November 7, 2023 at 4:35 am #1424860Hey Highlander-2013,
Thank you for the inquiry.
The other h1 element might be coming from the default title and breadcrumb container, which can be toggled in the Enfold > Header Layout > Header Title and Breadcrumbs settings. Please provide a link to the page containing the shortcode so that we can check it properly.
Best regards,
IsmaelNovember 7, 2023 at 8:49 am #1424882… sorry – soon there will be something more informing …
edit. a quick way is to replace that enfold h1 tag with jQuery in your child-theme functions.php:
or – maybe better try to change the heading in your shortcode of the plugin.function breadcrumb_change_tag(){ ?> <script type = "text/javascript"> window.addEventListener("DOMContentLoaded", function () { (function($) { $("#top #main .title_container .main-title").contents().unwrap().wrapAll('<div />'); })(jQuery); }); </script> <?php } add_action('wp_footer', 'breadcrumb_change_tag');
but i guess we can influence the heading via filter : avf_title_args – …
if there is a possiblility to influence the building of an element – it is alway better than to change it afterwards – so use the next solution instead.November 7, 2023 at 9:36 am #1424886try this instead in child-theme functions.php:
function replace_tag_for_breadcrumb_title($args,$id){ $args['heading'] = 'div'; return $args; } add_filter('avf_title_args', 'replace_tag_for_breadcrumb_title', 10, 2);
( you can find the args on enfold-functions.php on line 593ff )
_________________
just for info
by the way – woocommerce uses that filter to change the title on single product pages to “strong”
in this case it is in an if clause:if(is_single() && is_product()){ $args['heading'] = "strong"; }
November 7, 2023 at 12:37 pm #1424912This reply has been marked as private.November 7, 2023 at 12:39 pm #1424913November 7, 2023 at 12:52 pm #1424916das war ja auch gedacht um den Title vom Breadcrumb in etwas anderes zu transformieren als ein h1.
Dann würde das ja die Doppelt h1 Problematik lösen.
Wie gesagt – besser wäre es das Plugin , welches für den Shortcode zuständig ist zu betrachten.
der wird wohl das h1 setzen.
Denn das:<h1 class=”the_input_element” data-math-equation=”” data-original-math-equation=”” data-decimal-places=”0″>Angebot für eine PV-Anlage</h1>
ist nicht von Enfold seite aus gesetzt worden.Kann ich deine Seite mal sehen?
November 7, 2023 at 1:02 pm #1424917wenn gar nichts mehr hilft versuch das mal in der child-theme functions.php
(aber besser ist immer die Entstehung des Elements zu verändern)function replace_tags_with_tags(){ ?> <script> (function($) { function replaceElementTag(targetSelector, newTagString) { $(targetSelector).each(function(){ var newElem = $(newTagString, {html: $(this).html()}); $.each(this.attributes, function() { newElem.attr(this.name, this.value); }); $(this).replaceWith(newElem); }); } replaceElementTag('h1.the_input_element', '<h2></h2>'); }(jQuery)); </script> <?php } add_action('wp_footer', 'replace_tags_with_tags');
November 8, 2023 at 1:46 pm #1424987This reply has been marked as private.November 9, 2023 at 2:01 pm #1425114Hi,
Thanks for your patience and the link to your site, your NexForms popup has a H1 title:
and your special heading element is a H1:
So you should review your NexForms popup plugin and remove the H1 popup title and change the special heading element to H2, since it is in the middle of your page, typically H1 should be at the top of your page.Best regards,
MikeNovember 13, 2023 at 2:08 pm #1425445Thanks Mike,
its runs.Best Regards
GuidoNovember 13, 2023 at 5:32 pm #1425464Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Sektion H1 Problem’ is closed to new replies.