• Resolved bguy0501

    (@bguy0501)


    I’ve been trying to change the text of the Sticky Post banner on the website below using JavaScript and jQuery, but I can’t seem to get anything to work.

    http://www.showyourhumanity.org/

    I’ve tried the below examples. They seem to work when I use other online editors using both IDs and Classes using different variations of the class name and adding or removing the “.” before the class name.

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    <script>
    document.getElementsByClassName("sticky-badge").innerHTML = "SYH News";
    </script>
    $(.sticky-badge).html("SYH News");

    Is there something I’m missing?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author acosmin

    (@acosmin)

    Create a directory named post-templates in your child theme’s folder. After that copy/paste this file content.php from the parent theme (../post-templates/content.php) into the newly created folder.

    Open the file from the child theme and change this line:

    __('Sticky Post', 'justwrite')

    to what you want, for example:

    __('SYH News', 'justwrite')

    Thread Starter bguy0501

    (@bguy0501)

    Thanks so much, that worked perfectly!

    Theme Author acosmin

    (@acosmin)

    If you find the theme useful and have the time, please leave a review 🙂

    Thank you!

    Thread Starter bguy0501

    (@bguy0501)

    Yes, absolutely. I really like the theme!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Changing text of sticky post banner using JavaScript’ is closed to new replies.