• Resolved lisaleague

    (@lisaleague)


    Hi Robin,

    Thanks for this great plugin! I feel so much lighter already ??

    Is there a snippet I can add to my functions file or a customization plugin to change the H3 “Share this post” scriptlesssocialsharing__heading to paragraph text instead?

    Or is there a reason I would not want to do that?

    I’d primarily like to style differently, but since it’s not a true heading in the post, it seems to make sense that it is not a heading.

    Please let me know, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Robin Cornett

    (@littlerchicken)

    You can do that with a filter, or you can keep it as a heading and make your style changes as you like by targeting the class. To change it to a paragraph element instead of a heading, try this filter:

    
    add_filter( 'scriptlesssocialsharing_heading_element', 'rgc_change_scriptless_heading' );
    /**
     * Change the heading element to a <p> tag instead of <h3>
     *
     * @return string
     */
    function rgc_change_scriptless_heading() {
    	return 'p';
    }
    

    You might also consider using div or span instead of p, as it’s maybe not really a paragraph either, but it’s up to you. This snippet can be added to your functions.php file or wherever you keep similar code modifications. Please make sure your files are backed up and practice safe coding. HTH

    Thread Starter lisaleague

    (@lisaleague)

    Great idea Robin, I think a div works better. Thanks so much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change H3 to P’ is closed to new replies.