Add Anchor Links

描述

Creates anchor links to heading tags in the content of selected posts, just like Github does within the Readme.md files.

Get involved and join Github!

Features

  • Select post type where the anchor links will be added.
  • Disable CSS.

Compatibility

  • PHP (5.6) & PHP 7

安装

  1. Follow the standard WordPress plugin installation procedere.
  2. When installed, go to Settings -> Add Anchor Links and when should be applied.

常见问题

I want to use the latest files. How can I do this?

Use the GitHub Repo rather than the WordPress Plugin. Do as follows:

  1. If you haven’t already done: Install git

  2. In the console cd into Your ‘wp-content/plugins´ directory

  3. Type git clone https://github.com/vyskoczilova/add-anchor-links or better type git fork https://github.com/vyskoczilova/add-anchor-links

  4. If you want to update to the latest files (be careful, might be untested on Your WP-Version) type `git pull´.

I found a bug. Where should I post it?

I personally prefer GitHub, to keep things straight. The plugin code is here: GitHub
But you may use the WordPress Forum as well.

I found a bug and fixed it. How can I contribute?

Either post it on GitHub or—if you are working on a cloned repository—send me a pull request.

评价

2022年6月24日
This plugin works well and apparently works as intended. I'm probably missing something, but I don't understand why it scrolls the header to the top when the icon is clicked, instead of copying the corresponding anchored link (i.e."pageurl/#header-title)" to the clipboard. After all, the header already has to be in view in order to click the icon beside the header. If the plugin author would make the above modification and add an automatically fading "copied to clipboard," message, the plugin would be ideal, IMHO. ,
2020年6月10日
Add Anchor Links adds a beautifully designed embedded SVG link icon to the upper left of the headings, hidden by default and showing up when the mouse pointer hovers the heading’s box (extending over the full width). Thanks to Add Anchor Links, authors of posts and pages in any writing system don’t need to manually add IDs and hyperlinks to headings, nor extra CSS rules to remove the standard link style from the headings. Being an SVG coded in-line, the link icon is stable and very lightweight. It is easily copy-pasted along with the heading when the preceding paragraph break and (at least) one character before are included (the latter may be deleted afterwards). Instead of copy-pasting merely the URL, we can send the link in the icon with the heading, e.g. in an HTML email. The link icon’s positioning is also compatible with heading numbers added from CSS counters. Add Anchor Links is compatible with the Easy Table of Contents plugin. The reader doesn’t need to scroll to the TOC any more to pick a heading’s link. TOCs are often missing, at least when the number of headings in a given page doesn’t meet the setting for the TOC to be generated. Add Anchor Links is absolute top quality and a must-have plugin for use on all websites having h2 or lower-level headings. Visitors thankfully appreciate being able to easily cite particular sections in pages, articles and posts. A really easy way to significantly enhance user experience.
2020年3月16日
Thanks for this! It works exactly as described, adding id values to headings and showing an anchor item. Right-clicking allows users to capture a link to an exact section.
阅读所有4条评价

贡献者及开发者

“Add Anchor Links” 是开源软件。 以下人员对此插件做出了贡献。

贡献者

“Add Anchor Links”插件已被翻译至2种本地话语言。 感谢所有译者为本插件所做的贡献。

将“Add Anchor Links”翻译成您的语言。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志

更新日志

1.0.4

(2021-03-07)
* Make Kybernaut\AddAnchorLinks::add_anchors( $string ) function available for custom calls

1.0.3

(2021-03-07)
* Fix: Use escaping attribute on admin screens
* Add PHPCS & simple PHPUnit test
* Use Travis CI/CD (PHPCS, PHPUnit)

1.0.2 (2020-01-13)

  • Fix: Fix link position when header has attributes (PR#1 by @a-mt)

1.0.1 (2018-02-12)

  • Fix: Few typos in readme files.
  • Fix: Post types error.
  • Added: Notice about settings shown on plugin activation.
  • Added: Constant ADD_ANCHOR_LINKS_DONT_LOAD_CSS (see Github).
  • Added: Banner & icon image to the WP repository (by Dušan Konečný).

1.0.0 (2018-02-08)

  • Initial release