Description

Description

Kocuj Sitemap plugin adds shortcode [KocujSitemap] that puts the sitemap in the place where it is located. This allows you to display links to all of your posts, pages, menu items, authors, tags and custom types entries anywhere on your website - even within the article. There is also a PHP function that allows you to place the sitemap anywhere on the website. There is also possibility to use the widget to place a sitemap anywhere in the sidebar.

This plugin supports multilingual websites. If you have installed the plugin compatible with Kocuj Sitemap plugin (currently it is qTranslate X), the plugin will generate a sitemap on your website in accordance with the currently selected language. If you do not have the plugin that supports multilingualism, Kocuj Sitemap plugin will display a sitemap for the default language defined for your WordPress installation.

The sitemap is automatically generated and stored in the cache, which is used in the sitemap to avoid using the database when loading your website, after each change of any element in the administration panel (for example, when you change a post). This process speeds up the loading of the sitemap on your website.

The Kocuj Sitemap plugin can be used in standard or in multisite WordPress installation.

Features

  • Compatibility with HTML 5,
  • Multilingual websites support (with qTranslate X plugin),
  • Fast operation due to use of the cache,
  • Displaying posts, pages, menu items, authors, tags and custom types entries (with custom taxonomies),
  • Displaying all elements with dividing it by sections or without it,
  • Ability to change order of displayed entries,
  • Ability to exclude selected entries,
  • Ability to hide selected element types, for example, all posts,
  • Easily adding of the sitemap by using a shortcode with help of HTML or visual editor button,
  • Possibility to set left margin for each level in multi-level sitemap if theme has problems with displaying such a list,
  • Many configuration options,
  • Many filters for better control of the plugin.

Requirements

This plugin requires PHP 5.x (from 5.3) or PHP 7.x and WordPress 4.9 or greater. It works in standard and multisite WordPress environments. It is strongly recommended to use WordPress in the newest version. This plugin uses shortcodes so in Gutenberg (a WordPress editor from version 5.0) it will not work as block and shortcode should be added manually.

How to use

There are few possibilities to display the sitemap: * by using a shortcode [KocujSitemap] inside a post of any type, * by displaying a widget, * by using the PHP function anywhere in the code, for example, inside a theme.

The shortcode [KocujSitemap] has optional parameters:

  • homelinktext
    - text that will be used as the text for the link to the main page,
  • class
    - name of the style sheet class that will be added to the block element (
    div
    or
    nav
    ) containing the entire sitemap,
  • excludepost
    - comma separated list of identifiers for posts of any type (posts, pages, custom types entries) to exclude,
  • excludecategory
    - comma separated list of identifiers for post categories to exclude,
  • excludeauthor
    - comma separated list of identifiers for authors to exclude,
  • excludeterm
    - comma separated list of identifiers for post categories, post tags or custom taxonomies to exclude,
  • hidetypes
    - comma separated list of element types to hide; it can contains the following types: "author" (to hide authors), "custom" (to hide custom post types), "home" (to hide link to homepage), "menu" (to hide menus), "page" (to hide pages), "post" (to hide posts), "tag" (to hide tags).

For example, if you use [KocujSitemap homelinktext="NEW LINK TEXT" class="new_class"], the sitemap will be displayed in the block element (div or nav) with the CSS class new_class and link to the home page with text NEW LINK TEXT.

If you add other parameters, for example [KocujSitemap homelinktext="NEW LINK TEXT" class="new_class" excludepost="5,6" excludeterm="12" hidetypes="page"], the sitemap will be displayed in the block element (div or nav) with the CSS class new_class, link to the home page with text NEW LINK TEXT, there will be not displayed posts of any type with identifiers 5 and 6 and post tags and custom taxonomies with identifier 12 and all pages will be not displayed.

Instead of using the shortcode, you can edit the PHP file responsible for the theme. Kocuj Sitemap plugin defines global PHP function which declaration is as follows: <?php function kocujsitemap_show_sitemap($homeLinkText = '', $class = '', array $exclude = array(), array $hideTypes = array()); ?>. The parameters $homeLinkText and $class perform the same function as the corresponding parameters in the shortcode [KocujSitemap].

For example, if you use <?php kocujsitemap_show_sitemap('NEW LINK TEXT', 'new_class'); ?>, the sitemap will be displayed in the block element (div or nav) with the CSS class new_class and link to the home page with text NEW LINK TEXT.

More things should be sayed about $exclude parameter. It should contains an array of identifiers categorized (with correct key identifier) by entry type to exclude. There are the following entries types available:

  • post
    - for excluding posts of any type (posts, pages, custom types entries),
  • category
    - for excluding post categories,
  • author
    - for excluding authors,
  • term
    - for excluding post categories, post tags or custom taxonomies.

For example, the $exclude array containing array('post' => array(5, 6), 'term' => array(12)) will exclude posts of any type with identifiers 5 and 6 and post tags and custom taxonomies with identifier 12.

The parameter $hideTypes has list of elements types to hide. It can contains the following types: "author" (to hide authors), "custom" (to hide custom post types), "home" (to hide link to homepage), "menu" (to hide menus), "page" (to hide pages), "post" (to hide posts), "tag" (to hide tags).

For example, the $hideTypes array containing array('post', 'page') will hide all posts and pages.

There is also possibility to use widget. It has possibility to display the sitemap as standard or drop-down list. It has also the possibility to exclude selected elements or hide the selected elements types from the sitemap.

Configuration

There is option Sitemap in the administration panel, which is used to configure the behavior of the Kocuj Sitemap plugin. If you select any submenu item from the Sitemap menu, you will find yourself in a place where you can set specific options for the plugin.

The settings on each administration page are divided into tabs. There can be active only one tab at once. Tab is selected by clicking on its name.

Each tab contains a set of options. Each option has a description that is displayed when you set mouse cursor over it. You can also see more detailed information by clicking a Help button on top of the page.

Changes in the configuration can be saved by clicking on the Save settings button. There is a possibility to restore the settings that were set after installing the plugin, by selecting an option Restore settings in the plugin menu.

Remember, that removing the plugin will clean all its options saved into the database.

CSS classes

The Kocuj Sitemap plugin displays a sitemap using a few CSS classes, so you can customize the look of the sitemap to your requirements.

There are the following CSS classes available:

  • kocujsitemap
    - used by main container for the sitemap (
    nav
    or
    div
    ) in shortcode, PHP function and widget,
  • kocujsitemapwidget
    - used by main container for the sitemap (
    nav
    or
    div
    ) in the widget,
  • kocujsitemap-home
    - used by
    <li>
    element in the sitemap when the link is to the home page,
  • kocujsitemap-post
    - used by
    <li>
    element in the sitemap when the link is to the post of any type (post, page, custom type entry),
  • kocujsitemap-category
    - used by
    <li>
    element in the sitemap when the link is to the post category,
  • kocujsitemap-term
    - used by
    <li>
    element in the sitemap when the link is to the post tags or custom taxonomy,
  • kocujsitemap-author
    - used by
    <li>
    element in the sitemap when the link is to the author,
  • kocujsitemap-unknown
    - used by
    <li>
    element in the sitemap when the link is to something different than all above (for example, link to other website).

Planned features

  • Generating one sitemap for all blogs in multisite installation,
  • Creating more than one sitemap,
  • Easy control of shortcode parameters in HTML and visual editor,
  • Generating XML sitemap for search engines.

Contact

If you have any suggestion, feel free to use the contact form at http://kocujsitemap.wpplugin.kocuj.pl/contact/.

If you want to have a regular information about this plugin, please become a fan of plugin on Facebook: http://www.facebook.com/kocujsitemap

See also official plugin website: http://kocujsitemap.wpplugin.kocuj.pl