Where the [share] shot code can be edited?

This topic has 6 replies, 4 voices, and was last updated 6 years, 11 months ago ago by Rose Tyler

  • Avatar: ibiscomputer
    ibiscomputer
    Participant
    May 23, 2017 at 16:14

    Hi,

    I have purchased this theme and I want to edit the [share] shortcode in order to delete the social networks we don’t use, please can syou tell me where edit it?

    Thanks id advanced,

    5 Answers
    Avatar: rizath
    Rizath
    Member
    May 24, 2017 at 05:56

    Hello,

    To edit [share] shortcode you have to modify the file wp-content/themes/royal/framework/shortcodes.php (the section “! Share This Product”).

    Regards,
    Dilackson.

    Avatar: ibiscomputer
    ibiscomputer
    Participant
    May 26, 2017 at 10:44

    Hi,

    I suppouse that if I modify this, in future update the changes can be lost.
    Is possible to do it in the child theme? I should create the theme structure in the child theme to do it? Or maybe in the functions.php add one copy of the function and change the [share] name?

    Thanks!

    Avatar: maxmullins
    Max Mullins
    Participant
    May 26, 2017 at 11:32

    Hello @ibiscomputer,

    You should previously unset working fuction of parent theme to make child theme fuctiion work without errors. Please add following code into the functions.php of the child theme and replace ... with copy of the parent theme share shortcode functon.

    function remove_parent_functions() {
    remove_shortcode('share', 'etheme_share_shortcode');
    add_shortcode('share', 'etheme_share_shortcode_child');
    } 
    add_action('init','remove_parent_functions');
    
    function etheme_share_shortcode_child($atts, $content = null) {.....................

    Regards,
    Max Mullins

    Avatar: ibiscomputer
    ibiscomputer
    Participant
    May 26, 2017 at 12:17

    Great, that works fine!

    Thanks

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 26, 2017 at 13:03

    Hello,

    You’re welcome!

    Regards,
    Rose Tyler.

  • Viewing 6 results - 1 through 6 (of 6 total)

The issue related to '‘Where the [share] shot code can be edited?’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.