Skip to content

Transform WordPress elements into mid-page anchors using AnchorJS.

Notifications You must be signed in to change notification settings

robertandrews/cwp-anchorjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Context WP AnchorJS

Tested up to: 5.9.1
Tags: posts, wordpress, anchorjs
Contributors: robertandrews

Description

This WordPress plugin adds WordPress support for Bryan Braun's AnchorJS, a Javascript library that can add visual, mid-page anchor links to specified HTML elements.

AnchorJS examples

Installation

Add the plugin via Plugins > Add New > Add Plugins > Upload Plugin.

The plugin properly uses WordPress' wp_enqueue_scripts action to call two files:

  • AnchorJS (currently via CDN)
  • Your settings file

Usage

The settings file is where you specify which HTML elements to convert into visual anchors, whether to include hover links, which icons etc.

See AnchorJS settings in AnchorJS docs.

settings.js ships containing: anchors.add('article h3');

This turns <h3> elements into anchor links.

You can change the settings using AnchorJS' supported settings.

About

Transform WordPress elements into mid-page anchors using AnchorJS.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published