The Reporter - User Documentation
DemosSupport
  • πŸ‘‹Introduction
  • πŸ†•Changelog
  • 🏁GETTING STARTED
    • πŸ”½Uploading a Theme
  • πŸ“œMain Templates
    • πŸ“°Post Page/Post Page with Sidebar
    • 🐱Categories Page
    • πŸ§‘β€πŸŽ¨Authors Page
    • ♾️Archive (All posts) Template
  • βš™οΈCUSTOM SETTINGS
    • ℒ️Logos
    • πŸ”€Typography
    • 🀯Header
      • 🧭Header Type
      • πŸ“Header Height
      • πŸ” Header Navigation Font Size
    • πŸ“Border Radius
    • ⚑Featured Posts Section
    • 🍑Homepage Layout
      • πŸ“‘Homepage Tags
      • πŸ›οΈHomepage Sections Layout
  • πŸ‘£Footer Customization
    • πŸ₯ΎFooter Type
    • 🐾Footer Categories
  • πŸ“’CTA Text and Subtext
  • πŸ“ŸCustom Widget (HTML Widget)
  • 🀝MEMBERSHIP FEATURE
    • πŸŽ™οΈSetting Up
    • ℹ️Sign In Page
    • πŸ”ΌSign Up Page
    • *️⃣Subscribe Page
    • πŸ‘€Account Page
    • πŸ’ΈMembership Page
  • πŸ§‘β€πŸš€Advanced Customization
    • πŸ‘©β€πŸ«Introduction
    • 🏠Home Page
      • 🧱Sections Customization
      • πŸ’ˆBanners (CTA blocks) Customization
    • πŸ‘ŸFooter Tags
  • πŸ”©Other Settings
    • πŸ“ΉAdd 'Has Video Content' Icon
    • πŸ“ΈAdd Your Instagram Link (Icon)
    • ⏬Submenus
  • β˜‘οΈTERMS & CONDITIONS
    • πŸ”Refund Policy
Powered by GitBook
On this page
  • To add Custom Widget:
  • TO ADD 'STICKY' EFFECT:

Custom Widget (HTML Widget)

PreviousCTA Text and SubtextNextSetting Up

Last updated 11 months ago

The Reporter supports adding custom HTML Widget. That custom widget will show up inside sidebar on Posts with sidebar pages.

To add Custom Widget:

  1. Go to Settings > Design & branding from the admin menu and click Customize

  2. Click Site-wide in the Design settings sidebar on the right

  3. Find HTML WIDGET text input

  4. Paste HTML code, prepared for your widget and click Save

  5. To add CSS-styles, go to Settings > Code Injection

  6. Paste your CSS code inside Site header text input (Your CSS code should be inside )

  7. To add JavaScript code, go to Settings > Code Injection

  8. Paste your JavaScript code inside Site footer text input (Your JavaScript code should be inside )

TO ADD 'STICKY' EFFECT:

To add "sticky" effect to this widget (so It will stick to the screen when you will scroll page down) you can take this CSS and Javascript code:

CSS:

.gh-sidebar-custom-widget {
    position: sticky;
    animation: fadeIn 1s ease-in-out;
    transition: top 0.45s ease;
}
.gh-sidebar-custom-widget.with-big-header {
    top: 152px;
}
.gh-sidebar-custom-widget.with-small-header {
    top: 60px;
}
.gh-sidebar-custom-widget.moved {
    top: 32px;
}

JavaScript:

const moveWidget = () => {
  const widget = document.querySelector('#sidebar-custom-widget');
  let lastScrollTop = 0;

  const widgetScrollHandler = () => {
    const scrollTop = window.scrollY;
    const windowWidth = window.innerWidth;
  
    if (windowWidth > 1100) {
      if (scrollTop > 200) {
        if (scrollTop > lastScrollTop) {
          widget.classList.add('moved');
        } else {
          widget.classList.remove('moved');
        }
      }
  
      lastScrollTop = scrollTop;
    }
  };

  if (widget) {
    window.addEventListener('scroll', widgetScrollHandler);
  }
};

moveWidget();
πŸ“Ÿ
HTML tag <style></style>
HTML tag <script></script>