
-
AuthorPosts
-
June 19, 2025 at 2:34 pm #1485677
If you sort portfolios on a page, the title of the portfolio page is displayed as an h3. This is in the file config-templatebuilder/avia-shortcodes/portfolio/portfolio.php on line 1144 (default_heading = ‘h3’). However, we want an h2 instead of an h3. So I put the following function in the child’s functions.php:
function mo_avf_customize_heading_settings( array $args, $context, array $extra_args = array()){
if( $context == ‘avia_sc_portfolio’ ){
$default_heading = ! empty( $meta[‘heading_tag’] ) ? $meta[‘heading_tag’] : ‘h2’;
$args[‘heading’] = $default_heading;
}
return $args;
}
add_filter( ‘avf_customize_heading_settings’, ‘mo_avf_customize_heading_settings’, 10, 3 );But that doesn’t work. Where’s the error, please?
June 20, 2025 at 7:19 am #1485701i guess you are talking about the usage of the filter on line: 1156 – the other lines ( 3times that filter is set inside portfolio.php) allready do have h2 as default.
Can you show us that page it belongs too? You are definitly using the portfolio element to show those portfolios? Because there are many ways to show them even as masonry with portfolio-entries.these filters are used on a different context (see line 698) too – maybe try:
function my_portfolio_heading_settings( array $args, $context, array $extra_args = array() ){ if( $context == 'avia_post_grid' && is_array( $extra_args ) && in_array( 'not_one_column_template_special', $extra_args )){ $args['heading'] = 'h2'; } return $args; } add_filter( 'avf_customize_heading_settings', 'my_portfolio_heading_settings', 10, 3 );
June 20, 2025 at 8:39 pm #1485736Hi,
Thanks for sharing Guenni007, in my test this works for the portfolio grid element, but not the masonry element. My understanding is that Biggy is using the portfolio grid element.Best regards,
MikeJune 21, 2025 at 7:55 am #1485740That was exactly my impression, which is why I provided the code above.
__________________________
for masonry it is not that complicated because inside the helper : class-avia-masonry.php there is only one instance of that filter. And no extra_args are needed:function my_masonry_customize_heading_settings( array $args, $context){ if( $context == 'avia_masonry' ){ $args['heading'] = 'h2'; } return $args; } add_filter( 'avf_customize_heading_settings', 'my_masonry_customize_heading_settings', 10, 2 );
June 21, 2025 at 12:17 pm #1485744June 22, 2025 at 11:16 am #1485770It was for the portfolio grid element. Guenni’s function works perfectly.
Thanks for your help. This post can be closed.June 22, 2025 at 12:55 pm #1485772Hi,
Glad Guenni007 could help, thank you Guenni007, 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 ‘Entry title h3 in a portfolio’ is closed to new replies.