-
AuthorPosts
-
June 6, 2023 at 3:46 am #1409711
Hi, I found an old code you suggested in the past on how to change the caption from H2 to H1 but it broke the caption design (instead of white font with gray frame it became black font with no frame).
Any idea? It’s pretty crucial for us because we use the caption in the slideshow as the main title of the page, and by all SEO suggestions, it needs to be a H1 tag.
Thank you.
June 6, 2023 at 3:50 am #1409717Hey!
Thank you for the inquiry.
Did you adjust the options in the Advanced > Heading Tag > Heading Tag (Theme Default is h2) settings? We may need to inspect the site in order to understand the issue better. Please provide the site details in the private field.
Regards,
IsmaelJune 6, 2023 at 3:55 am #1409719Not sure what setting I should look for.
Are you referring to the setting block Theme Options > Advanced Styling > All Headings (H1-H6)? If so, what exactly do I need to change there?Thanks!
June 6, 2023 at 3:59 am #1409721Nevermind I see what you’re talking about. There’s a setting in the image page inside the fullwidth slider. Thank you!
June 6, 2023 at 4:01 am #1409722Hey!
Great! Glad to know that you’ve found the Heading Tag settings. Let us know if this helps.
Best regards,
IsmaelJune 6, 2023 at 4:29 am #1409724Yes technically it works but I need to go thru dozens of pages and change it manually, if there was an easy way to edit the default from H2 to H1 that could have been amazing.
Also if there was an option to edit the default caption title font size and caption content font size on mobile view that could save me a bunch of work.
- This reply was modified 1 year, 6 months ago by 0_o.
June 6, 2023 at 7:18 am #1409727the change on color of the h1 had to be set in quick css. But with that filter here the option if framed or not is preserved.
function my_avf_customize_heading_settings( array $args, $context, array $extra_args = array() ){ if( $context == 'avia_slideshow' ){ $args['heading'] = 'h1'; } return $args; } add_filter( 'avf_customize_heading_settings', 'my_avf_customize_heading_settings', 10, 3 );
but i do not see how to differ between fullscreen and fullwidth sliders – the filter is inside the helper: class-avia-slideshow.php
and f.e. no extra_args are set.maybe the filter avf_slideshow_title can be used – but i think it is only to change the content of title .
June 6, 2023 at 7:37 am #1409730This could also be used as a snippet – but from a SEO point of view it would probably be better not to replace an existing H2, but to change the build process to H1.
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('.avia-fullwidth-slider h2.avia-caption-title', '<h1></h1>'); }(jQuery)); </script> <?php } add_action('wp_footer', 'replace_tags_with_tags');
June 9, 2023 at 11:09 pm #1410103 -
AuthorPosts
- You must be logged in to reply to this topic.