-
AuthorPosts
-
July 9, 2021 at 3:11 am #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.July 12, 2021 at 5:17 am #1309672Hey 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,
IsmaelJuly 12, 2021 at 11:00 am #1309716Hi 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.
July 13, 2021 at 10:39 am #1309906Hi,
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,
IsmaelJuly 13, 2021 at 11:36 am #1309925Hi. Please see private.
- This reply was modified 3 years, 4 months ago by laptophobo.
July 13, 2021 at 12:34 pm #1309938Hi,
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,
IsmaelJuly 13, 2021 at 12:42 pm #1309940Right. 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.
July 17, 2021 at 7:01 pm #1310523Hi,
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.
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,
MikeJuly 18, 2021 at 8:17 am #1310570Hi 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.
July 18, 2021 at 1:58 pm #1310596Hi,
I found the correct $context for Ismael’s function, this is working in my tests, please try this in your child theme functions.phpfunction 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,
MikeJuly 19, 2021 at 4:01 am #1310653Yes, that worked!
Thanks for your help (yet, again), Mike.
July 19, 2021 at 5:06 am #1310660Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘change header in Share This Entry in post default’ is closed to new replies.