Plugin / Author Categories

MAKE SITES

Description

Description

Numerous people are using WordPress for blogging and in many cases there are more than one authors on a website. It’s uncomfortably surprising that WordPress doesn’t support out of the box a category menu for each author separately.

I was looking for this feature online for my personal need but couldn’t find it on any plugin. To be exact I was using a modified version of another similar plugin but that was until version 2.3 where the database structure changed for WordPress and it simply stopped working.

As I saw it, it wasn’t worth fixing old, deprecated (and highly cluttered) code, and there weren’t any other solutions out there, so I decided to create a new plugin. Thankfully the new database and API made it as easy as I had hoped for.

I ended up with this plugin, that was created as a wrapper of the default category menu.

It is lightweight and can easily plug-in, plug-out. Furthermore, being an extension of the default category menu, means that none of the functionality (sorting, post count etc.) is lost. In fact it can be easily extended and could support future versions of the blogging platform for years to come.

Usage

After you upload an activate the plugin through your admin panel, all you need to do is call the custom function wp_author_categories() that will create an author’s menu for you. Notice that this only works in author pages and will revert to the default category menu in any other case.

If you are using the default template, you can easily find this line in “sidebar.php” (that displays the category menu):
< ?php wp_list_categories('show_count=1&title_li=Categories’); ?>

You can replace it with this condition that will use the wp_author_categories() function instead, when you are visiting the author pages

        <?php 
        /*
        * First write down the arguments you want to use for you menu and store them in a variable. 
        * These are the same for the default menu ("wp_list_categories") and the author menu ("wp_author_categories")
        * you can find more information on the options you can use here: https://codex.wordpress.org/Template_Tags/wp_list_categories
        */
        $args = 'show_count=1&title_li=<h2>Categories</h2>';
        if($author){
            wp_author_categories($args); 
        } else{
            wp_list_categories($args); 
        }
        ?>

Alternatively, and if you already have an “author.php” file in your template folder, you can simply rename “wp_list_categories()” to “wp_author_categories()”, passing the same arguments.

To uninstall, it’s as easy as doing the reverse actions. Delete all references of the wp_author_categories() function from your template files and uninstall the plugin through that WordPress’s admin panel.

License

This work is released under the terms of the GNU General Public License:
http://www.gnu.org/licenses/gpl-2.0.txt

DIRECTORY DISCLAIMER

The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.

The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.

Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.

While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.

wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.

Keep Leading Your Followers!
Share it for them.