WordPress.org

Ready to get started?Download WordPress

Forums

Question and Answer Forum
Output category separately (3 posts)

  1. farraday1
    Member
    Posted 1 year ago #

    Hi there,

    I am trying to incorporate your nice plugin into my template because I want every post to have a "table" of questions belonging to that post below the article. My answers.php is working quite well for that case and I am also modifing the comments function in my functions.php.
    What I need now is a code/shortcode to display/output the question-categories and the link to the question-post IN the template. I tried many different things like <?php get_the_category($question->ID); ?> but it wouldn´t output anything.
    I checked your plugin source code many times but I am not expert enough I guess.

    What I don´t want to do is modify your plugin-codes as any update from your site would overwrite it, right? I am not touching plugins for that reason.

    Any idea how to output the desired information?

    I am very gradeful for any help! Thanks!

    http://wordpress.org/extend/plugins/question-and-answer-forum/

  2. trevorpythag
    Member
    Plugin Author

    Posted 1 year ago #

    Questions are essentially just posts with the 'question' post type. That means you can get the category in the normal way so using get_the_category($question->ID) should work. Have you allowed for the fact this function returns an array of objects etc?

    Hope I can help,
    Dave

  3. farraday1
    Member
    Posted 1 year ago #

    Hi Dave,

    thanks for your reply. Your plugin is exactly what I need but I almost gave up customizing it. But I think there are some general problems:

    - <?php get_the_category( $question->ID ); ?> is not working, no error, but not showing anything. But if I check the Qusteions -> Category List in the Backend it will show me all my Post categories and the numer of articles, not questions. If I click on that numer, I get to the list of questions though. So maybe this is why I don´t get an output with my code?

    - I translated the plugin into German and put the mo and po into the language folder which was back with the latest update. But the translation doesnt work. I can provide you with the files to include them into the next update.

    - I´d like to use tags for the questions aswell. Is that possible without touching the plugin files?

    I really hope I can make this work for my project. It´s so close to what I need.

    I appreciate your help!

    Thanks, T.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic