Required Footer Scripts

by: Admin » Published: 2025-06-21

To ensure all dynamic features in your static HTML website function properly, HTFY Publisher relies on a set of JavaScript files. These should be added before </body> (after </footer>) in your site's theme via the Theme Editor → Footer section.

Below are the required files for each feature:

✅ Visitor Count System

Purpose: Displays real-time and all-time visitor statistics.

<script src="/ht-admin/status/analysis-visitor.js" defer></script>

If visitor analytics are not showing on your article or page, go to Theme Editor → Footer, and make sure this line is added after </footer> and before </body>.

Comment Box (Form)

Purpose: Shows the comment box on article pages.

<script src="/ht-admin/comments/comments-form.js" defer></script>

If the comment form is not visible on your site, add this line to the footer using Theme Editor.

Search System

Purpose: Enables global search across the website using a special link.

<script src="/ht-admin/search-form/search_term-main.js" defer></script>

Required Link:

<a href="?search_term=search" title="Search Term">Search</a> 
 

When this link is clicked, a search box will appear for users to query site content. Without this JS file, search won’t activate.

Latest Posts in Article Footer

Purpose: Automatically shows latest blog posts at the bottom of every article page.

<script src="/ht-admin/latest-post-in-page/script.js" defer></script>

Add this to your footer to enable dynamic latest post previews on all articles.

Advertisement System (Lazy Load Ads)

Purpose: Enables auto ad loading, scroll-based ad display, and ad placement inside posts.

<script src="/ht-admin/Advertisement/main-script-apply-ads.js" defer></script>
Without this, even if you’ve set up ads in the dashboard, they won’t appear on the website.

Table of Contents (TOC)

Purpose: Automatically generates a Table of Contents for long articles using headings.

<script src="/js/toc-generator.js" defer></script>
Ideal for SEO and user navigation. Add this in the footer for articles with multiple headings (<h2>, <h3>, etc.).

How to Add These Scripts

  1. Go to HTFY Publisher → Theme Editor → Footer.

  2. Add the relevant <script src="..."></script> tags after </footer> and before </body>.

  3. Save and reload your website page.