Working with the Affix Widget

A custom made affix widget has been included with the theme. The widget on the right hand side of this article (if you are viewing on a desktop wide enough) is the output.

Creating this widget is pretty simple. Read on to know how.

Adding the Widget

Affix Widget Settings

From Appearance  Widget drag and drop the Affix widget on the Sidebar. This has only one settings, ie, if you want to make it sticky or not. By default it sticks to the window if the viewport is wide enough. If you want to disable it, then simply uncheck the checkbox.

If you choose to make the affix widget sticky, then do not add any other widgets on the sidebar. Also, make sure you have only one instance of Affix Widget on a page.

Widget Output

Affix Widget

Both the image above and the widget beside this article shows the output. It has the following components.

Search Bar for the current category

A search bar which will search articles from the top-most parent category of the current article. It simply means, this search bar will search from a particular knowledge base (since a parent category represents a knowledge base).

Table of Contents

A collapsible TOC generated automatically from the <h2><h3> and <h4> tags of your article. This is completely automatic, you do not have to do anything on your end.

Plus, the collapsible button on the TOC is persistent (based on cookies). If a user collapses it, then as long as the cookie is present in her browser, it will stay collapsed.

Support Link

If the top-most category has a support link, then it will show up as a button below the TOC.

Child Categories

All child categories of the parent category of the article will list up along with their icons.

Related Articles

The active child category will also show all other articles under it.

Here also the collapsible button is persistent, meaning anyone’s preference will be saved on her computer.

Swashata has written 247 articles

Hi there, I am the Lead Developer at WPQuark.com. I love to create something beautiful for WordPress and here I write about how to use them. When I am not working, usually I am doing a number of other creative things ;).