How to Create a Wiki Knowledge Base Using WordPress

Are you wanting so as to add a assist / documentation part to your website? Need to know the easiest way so as to add a wiki knowledge base to your WordPress website? On this article, we are going to present you how one can create a wiki knowledge base in WordPress.

There are three alternative ways you’ll be able to construct a wiki website inside WordPress:

  • You should use a devoted WordPress wiki theme to construct your knowledge base.
  • You should use a devoted WordPress wiki plugin to construct your knowledge base.
  • You should use some customized code snippets to construct your knowledge base.

Now there are execs and cons to every methodology. However don’t fear, we are going to clarify every of them, so you may make the correct selection.

WordPress Wiki & Knowledge Base Theme Methodology

One of many best option to construct a wiki is to make use of a WordPress wiki knowledge base theme. There are tons of them obtainable, however we suggest KnowHow Theme.

One of the best ways to setup is to set up WordPress on a subdomain or listing like assist.yoursite.com or yoursite.com/knowledgebase/

As soon as performed, you simply want to put in and activate the KnowHow theme and it’ll work out of the field.

The most important draw back of utilizing any WordPress Wiki & Knowledge Base theme is that you simply can’t use them in your fundamental website. You must do the setup on a subdomain or listing as a result of these themes do probably not match your branding, and also you positively are not looking for your homepage to be a wiki.

Nevertheless many websites have their knowledge base on a subdomain, so this isn’t as unhealthy because it sounds. The choice actually comes right down to your desire.

WordPress Wiki & Knowledge Base Plugin Methodology

If you wish to add a wiki knowledge base to your current WordPress website, then the best option to do it’s through the use of a WordPress wiki knowledge base plugin. There are a number of plugins obtainable, however we suggest Knowledge Base by PressApps (Dwell Demo obtainable).

All it’s a must to do is set up and activate the plugin. As soon as activated, it provides a Knowledge Base tab in your WordPress admin space.

Knowledge Base is it’s personal customized publish sort with classes and tags which lets you set up your documentation.

The perfect half about that is which you can add it in your fundamental website, and it’ll match your model type / formatting for probably the most half. It additionally comes with public / member solely voting system, customized widgets, drag-drop performance, and so forth. The draw back is that it prices $20.

In our subsequent methodology, we are going to present you how one can accomplish all of this free of charge, however it does contain code.

WordPress Wiki & Knowledge Base Code Snippet Methodology

One other manner so as to add a wiki knowledge base to your current WordPress website and even create a devoted wiki website is to make use of the code snippet methodology.

The draw back is that it’s a must to copy/paste a bit little bit of code which will be scary for learners. The upside is that it provides you extra freedom, and it’s fully free not like the primary two choices.

We’ll do our greatest to provide step-by-step directions.

Observe: Earlier than you begin, please create a whole backup of your WordPress website.

Very first thing it is advisable to do is set up and activate the Knowledgebase CPT plugin. This easy plugin creates a customized publish sort known as knowledge_base and a taxonomy known as part.

This lets you simply add your wiki articles and set up them into sections.

Upon getting a number of articles and sections, you would wish to show them in your web site. That is the place it is advisable to cope with a bit little bit of code.

Begin by including this code snippet into your theme’s features.php file or a site-specific plugin.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function wpb_knowledgebase() {
    // Get Knowledge Base Sections
    $kb_sections = get_terms('section','orderby=name&hide_empty=0');
    // For each knowledge base section
    foreach ($kb_sections as $section) :
    $return .= '<div class="kb_section">';
    // Display Section Name
    $return .= '<h4 class="kb-section-name"><a href="'. get_term_link( $section ) .'" title="'. $section->name .'" >'. $section->name .'</a></h4><ul class="kb-articles-list">';
    
    // Fetch posts in the section
    $kb_args = array(
        'post_type' => 'knowledge_base',
        'posts_per_page'=>-1,
        'tax_query' => array(
            array(
                'taxonomy' => 'section',
                'terms'    => $section,
            )       ,
        ),
    );
    
    $the_query = new WP_Query( $kb_args );
        if ( $the_query->have_posts() ) :
            while ( $the_query->have_posts() ) : $the_query->the_post();
                $return .=  '<li class="kb-article-name">';
                $return .=  '<a href="'. get_permalink( $the_post->ID ) .'" rel="bookmark" title="'. get_the_title( $the_post->ID ) .'">'. get_the_title( $the_post->ID ) .'</a>';
                $return .=  '</li>';
            endwhile;
    wp_reset_postdata();
         else :
                $return .= '<p>No Articles Found</p>';
        endif;
    $return .=  '</ul></div>';
    endforeach;
    return $return;
}
// Create shortcode
add_shortcode('knowledgebase', 'wpb_knowledgebase');

This code lists all of the knowledge base articles underneath the part they had been filed in.

Subsequent all it is advisable to do is create a brand new WordPress web page and add [knowledgebase] shortcode inside it. Save your web page and preview it.

You May Also Like : How to Put a Stop to WordPress Trackback Spam

It appears to be like very plain proper now, however we are able to add some styling to it. You should use this CSS as place to begin after which proceed enhancing to match your individual colours.

Paste the next code in your theme’s type.css file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
.kb_section {
float: left;
width: 280px;
max-width: 280px;
margin: 10px;
background-color: #f5f5f5;
border: 1px solid #eee;
}
h4.kb-section-name {
background-color: #eee;
margin: 0;
padding: 5px;
}
ul.kb-section-list {
list-style-type: none;
list-style: none;
display: inline;
}  
li.kb-section-name {
list-style-type: none;
display: inline;
}
ul.kb-article-list {
list-style-type: none;
list-style: none;
}  
li.kb-article-name {
list-style-type: none;
}
div.kb_section:nth-of-type(3n+1) {clear:left;}
div.kb_section:nth-of-type(3n+3) {}

This the way it seemed on our demo website the place we’re utilizing Twenty Twelve theme.

By default, your sections might be displayed in alphabetical order. Nevertheless if you wish to change the order of sections, then you are able to do that by putting in Customized Taxonomy Order NE plugin. It will let you drag-drop your sections in the correct order.

That’s all, we hope this text helped you add a Wiki knowledge base part in your WordPress website. You might also wish to take a look at our tutorial on how one can add a FAQs part in WordPress.

If you liked this article, make sure to hit the bell for getting our latest updates and share this article with your friends in every social media platforms.

1 thought on “How to Create a Wiki Knowledge Base Using WordPress”

  1. Pingback: How to Display the Latest Sticky Posts in WordPress

Leave a Comment

Your email address will not be published. Required fields are marked *