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

    #1485701

    i 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 );
    #1485736

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

    #1485740

    That 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 );
    #1485744

    Hi,
    Thanks for sharing Guenni007, this works well for masonry.

    Best regards,
    Mike

    #1485770

    It was for the portfolio grid element. Guenni’s function works perfectly.
    Thanks for your help. This post can be closed.

    #1485772

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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Entry title h3 in a portfolio’ is closed to new replies.