I need to change the heading tag in the fullwidth slider from h2 to h1. I found this script in another post:
I tried this function but it does not alter anything.
Any idea on what to change in order to make it work
Regards
Nina
Hey Advantage09,
You can set your preferred tag by clicking into each slide, then go to Advanced->Heading tag.
Best regards,
Rikard
or if you like to change that globally ( those which are set as Rikard said are not influenced by the snippet – only those headings are changed where the setting is default.)
put this to your child-theme function.php:
function my_avf_customize_heading_settings( array $args, $context, array $extra_args = array()){
if( 'avia_slideshow' == $context ){
// get class of slideshow
$slider_class = get_class( $extra_args[2] );
if( in_array( $slider_class, [ 'avia_sc_slider_full' ])){
$index = $extra_args [1];
if( '' == $attr['heading_tag'] && 0 == $index ){
$args['heading'] = 'h1';
}
}
}
return $args;
}
add_filter( 'avf_customize_heading_settings', 'my_avf_customize_heading_settings', 10, 3 );
see: https://webers-testseite.de/slider-caption/
PS:
avia_sc_slider_full is the fullwidth-slider
avia_sc_slider_fullscreen is the fullscreen slider
avia_sc_slider is easy slider
PPS: this is the better method than mine from https://kriesi.at/support/topic/changing-the-caption-title-on-fullwidth-easy-slider-to-h1/#post-998732
This controls the generation of these headings – the jQuery script only replaces them after the creation process.