Search code examples
wordpressfunctionlabelsharingwordpress-jetpack

Jetpack Sharing label how to customize it from functions


Hello Everyone, I am trying to edit the Sharing label text of Jetpack plugin but having a problem to target specific text for example

in jetpack sharing settings there is an option with input field called

Sharing label

to add text before sharing icons. I have written there

Love it? Share it

here i want to add css style of italic and bold to

 Share it

text but cannot do from text field as it not allow html tag. Is there any way i can target this specific share it text using css or function?

Here is piece of code btw with class assigned to that text

<h3 class="sd-title">Love it? Share it</h3>

Solution

  • you can replace text by using java script and set css.

    add below function in function.php

    function myscript() {
    ?>
    <script type="text/javascript">
    jQuery( document ).ready( function( $ ) {
        jQuery( '.sd-title' ).html("Love it? <span class='share_it'>Share it</span>");
    } );
    </script>
    <?php
    }
    add_action( 'wp_footer', 'myscript' );