Replacing Wiki discussion with normal comments

I'm building a hybrid type wiki site, basically a cut down, simplified wiki for astronomy students.

I would like to get rid of the "Discussions" tab and instead use the normal Wordpress comments feature.

Assume I need to edit the plugin files somehow. This is no issue for me to do, I just need someone to point me in the right direction.

Thanks.

  • Mike
    • New Recruit

    Hi @Carl

    Thanks for posting your question today!

    The discussions tab already uses the normal Wordpress comments system so there is nothing you need to change :slight_smile:

    I hope this is good news to you!

    Cheers,
    Mike

  • Carl
    • Flash Drive

    Hi Mike,

    Thanks for the response. That's great news. So, my next question is ... what do I need to edit so the contents of that tab appear beneath the wiki content (like on a normal blog post) rather than behind a tab?

    Cheers,
    C.

  • Carl
    • Flash Drive

    Thanks Mike. That's given me a bit of a lead. Looks like there is a function: $wiki->tabs() which returns this information.

    I'll try to track it down and override it in a separate file. At least that way, upgrades shouldn't be totally botched.

    Will post my results here in case anyone else is interested.

  • Carl
    • Flash Drive

    So, have hacked away at this for a little while and come up with a solution. This page provided some insight into the wiki templates if people are interested in that.

    Instructions
    1. Locate your themes directory for your currently active theme.
    2. Add the following two files to this directory: incsub_wiki.php and incsub_wiki-functions.php. The links there provide the code to add to each of these files.
    3. That's it!
    These are new files to your installation so you shouldn't try to replace any existing files with similar filenames. This way, you can upgrade the wiki plugin without impacting your site (hopefully!)

    Template file
    The template file is the incsub_wiki.php so you can modify this at will to reorganise or play around with the formatting of the single wiki page display. It's the same as the original incsub_wiki.php file you'll find in the plugin directory with a few minor changes.

    1. Firstly, I have added some include code at the top (explained below).
    2. Secondly, the call to $wiki->tabs() has been replaced with mytabs().
    3. Thirdly, I've included some code to display normal Wordpress comments beneath the post.

    The heavy lifting
    The incsub_wiki-functions.php file contains some of the replacement code for the plugin. The wiki plugin overrides many of the standard Wordpress comment features. This file restores the main ones back to normal.

    The key piece for you though is the mytabs() function. In it you can show/hide some of the tabs. I've chosen to hide the discussion, advanced, and create new tabs. You can delete the lines you want for your purposes:

    unset($array[1]); // discussion tab
    unset($array[4]); // advanced
    unset($array[5]); // create new

    Testing
    I've only tested this with the "Swedish Greys" theme I'm using and even then, not exhaustively. Keen to hear results from anyone else who wants to try doing the same thing.

    It would be great if WPMUDEV could include a setting for this in the next release of the wiki plugin.

    Cheers,
    Carl

  • lwevans
    • WPMU DEV Initiate

    Hi Carl,

    Thanks for posting. The functions work great. I tested it on my theme but it seems that some of the CSS wasn't working properly but I fixed it by adding more to the inline css you had.

    I can't believe that this wiki plugin is so half done. I've already gotten random people edit the wiki with no IP addresses. Also there isn't a display picture for the wiki pages on the widget menu. And on top of that the descending and ascending doesn't work.

    That being said, thank you for contributing. I hope WPMUDEV starts working for quality because it's insane to have subscribers pay for subscription to access these plugins and they are half done!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.