Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1309314

    When I create a new Post, by default, there is a Share This Entry bar at the bottom. The title is pre-set at “h5”. I would like to change that to “p”.
    I looked within enfold>config-templatebuilder>avia-shortcodes>social_share>social_share.php file, but could not locate “h5” header code.

    #1309672

    Hey laptophobo,

    Thank you for the inquiry.

    You can actually use a filter to adjust the heading tag to something else.

    function avf_customize_heading_settings_mod( array $args, $context, array $extra_args = array() ) {
      if( $context == 'avia_social_media_icons') {
        $args['heading'] = 'h1';             
      } 
      return $args;
    }
    add_filter( 'avf_customize_heading_settings', 'avf_customize_heading_settings_mod', 10, 3 );
    

    Best regards,
    Ismael

    #1309716

    Hi Ismael,
    I added your code to my child function.php file and it did not change anything.

    FTP access is in private if you want to look.

    #1309906

    Hi,

    Would you mind providing a direct link to a page or post containing the sharing button? Just to make sure that we are actually referring to the same thing. A screenshot will also help.

    Best regards,
    Ismael

    #1309925

    Hi. Please see private.

    • This reply was modified 3 years, 4 months ago by laptophobo.
    #1309938

    Hi,

    Are you referring to this title?

    
    <h5 class="av-share-link-description av-no-toc ">Share this entry</h5>
    

    Try this filter to change h5 to p.

    function avf_customize_heading_settings_mod( array $args, $context, array $extra_args = array() ) {
      if($context == "avia_social_media_icons") {
          $args['heading'] = 'p';   
      }          
      return $args;
    }
    add_filter( 'avf_customize_heading_settings', 'avf_customize_heading_settings_mod', 10, 3 );
    

    Best regards,
    Ismael

    #1309940

    Right. That’s what you provided before.

    I had placed your code in child function.php file. I had replaced the ‘h5’ with ‘h1’ and ‘p’ but nothing changes. (I refreshed the server files and cleared my cache too.)

    • This reply was modified 3 years, 4 months ago by laptophobo.
    #1310523

    Hi,
    Thank you for your patience, I couldn’t work out a function like Ismael had, but I found the location in the theme to make the change, please look in \wp-content\themes\enfold\includes\helper-social-media.php on line 646, look for $default_heading = 'h5'; and change to suit.
    2021-07-17_003.jpg
    But unfortunately, you can’t override a helper function inside a child theme by moving the file to the child theme.
    It seems that we worked on a similar issue, did you want to try modifying the script for this?

    Best regards,
    Mike

    #1310570

    Hi Mike,

    Yes, we had discussed a similar problem per your linked example. For this one, you say that the fix can only occur in the parent theme, not the child? If that is true, then my edits will be lost in the next Enfold update?
    But if you could figure out a solution that will work within the child theme, that would be great. (My fallback plan would be to hide the title altogether using CSS.)

    • This reply was modified 3 years, 4 months ago by laptophobo.
    #1310596

    Hi,
    I found the correct $context for Ismael’s function, this is working in my tests, please try this in your child theme functions.php

    function social_share_links_heading_mod( array $args, $context, array $extra_args = array() )
    {
    
    	if( $context == 'avia_social_share_links' )
    	{
    		$args['heading'] = 'p';
    	}
    	return $args;
    }
    
    add_filter( 'avf_customize_heading_settings', 'social_share_links_heading_mod', 10, 3 );

    Best regards,
    Mike

    #1310653

    Yes, that worked!

    Thanks for your help (yet, again), Mike.

    #1310660

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘change header in Share This Entry in post default’ is closed to new replies.