• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Can't dismiss sticky message

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Can't dismiss sticky message

This topic is: resolved

Tagged: sticky message

  • This topic has 2 replies, 2 voices, and was last updated 6 years, 3 months ago by vissersj.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • October 24, 2019 at 12:22 am #494229
    vissersj
    Participant

    Please look at the sticky message on website https://tinyurl.com/yytfgflk . When you click on the dismiss button, the page goes to the top and the sticky message is coming back when scrolling down. Any idea how to resolve this issue?

    https://tinyurl.com/yytfgflk
    October 24, 2019 at 8:16 am #494234
    AnitaC
    Keymaster

    That sticky message isn't a part of any theme. You've added some sort of script to do that. You should check with the script. But you also have the site optimized so there could be something in your optimization that is preventing it from going away permanently so look there.


    Need help with customization or troubleshooting? Reach out to me.

    October 25, 2019 at 2:33 am #494246
    vissersj
    Participant

    It's not optimization and I understand it has something to do with the script, but what? I have added the script below in functions.php and the necessary javascript/css. I know it should work, because it works on website https://tinyurl.com/yyeg7lnn .

    // Enqueue Scripts and Styles.
    add_action( 'wp_enqueue_scripts', 'oc_enqueue_scripts_styles' );
    function oc_enqueue_scripts_styles() {

    wp_enqueue_script( 'oc_sticky_message', get_bloginfo( 'stylesheet_directory' ) . '/js/sticky-message.js', array( 'jquery' ), '1.0.0' );
    }

    //* Register widget areas
    genesis_register_sidebar( array(
    'id' => 'sticky-message',
    'name' => __( 'Sticky Message', 'oc' ),
    'description' => __( 'This is the sticky message section.', 'oc' ),
    ) );

    // Add markup for the sticky message.
    add_action( 'genesis_before', 'oc_sticky_message' );
    function oc_sticky_message() {

    genesis_widget_area( 'sticky-message', array(
    'before' => '<div class="sticky-message">',
    'after' => '<span class="screen-reader-text">Dismiss</span></div></div>',
    ) );
    }

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Can't dismiss sticky message’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble