Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author trevorpythag

    (@trevorpythag)

    you should be able to restrict the categories by selecting ticking the ones you want users to be able to ask question in on the Q&A Settings page under settings in the wordpress admin area.

    Thread Starter charlesalder

    (@charlesalder)

    Thanks

    Yes I have done that and the code on the page where this code is
    http://www.talkingeducation.com.au/test
    [question_form width=\’x\’ bordercolor=\’x\’ style=\’x\’]Ask us a Question [/question_form]
    It works fine, it only allows users to submit a question under the chosen category

    When I insert this code
    [list_questions] it pulls all the categories of the site, whereas I only want it to pull the categories under which questions have been asked

    Plugin Author trevorpythag

    (@trevorpythag)

    Sorry I miss read your question.

    This seems to be a bug in the software. It seemed easy to fix but the fix is having knock on effects on the permalinks that I don’t understand at the moment. When I resolve the issue I’ll update the plugin.

    However you can try to implement the fix yourself too see if it will work on your installation. To do this open querys.php in the plugins folder. Then scroll down to line 65 (about a third of the way through the file) – the line immediately after

    $categories = get_categories();
    	foreach ($categories as $category) {

    you need to add the code

    if(get_option('q_cat_' . $category->term_id) == "TRUE")
    		{

    directly after the foreach line. Then after
    $loophtml .= '</option>';
    you need to add a }
    so that the whole block reads

    $categories = get_categories();
    	foreach ($categories as $category) {
    		if(get_option('q_cat_' . $category->term_id) == "TRUE")
    		{
    			$loophtml .= '<option value="' . get_bloginfo('wpurl') . '/question/recent?cat=' . $category->term_id ./* '&post_type=' . $q_question_post_type . */'">' . $category->cat_name;
    			$loophtml .= ' (' . $category->category_count . ')';
    			$loophtml .= '</option>';
    		}
    	}

    However as I said this was causing problems when I tested in on my local installation.

    Alternatively you can remove the dropdown box altogether by adding
    .question-cat-menu{display:none;}
    to your style sheet.

    Ill update this when I get the fix functioning properly and I have updated the plugin.

    Thread Starter charlesalder

    (@charlesalder)

    Dave, almost there

    http://www.talkingeducation.com.au/ask-us-a-question
    It shows the one question from the category but both the drop down catorgy and the view all questions fail

    But the link to the question on the page does work, Can I help you

    Using the drop down it links to this url
    http://www.talkingeducation.com.au/?cat=41&post_type=question

    Clicking View all Questions
    http://www.talkingeducation.com.au/?post_type=question

    Plugin Author trevorpythag

    (@trevorpythag)

    Im not sure why that’s happening.

    Have you tried resetting the permalinks since installing the plugin? Try going to Settings>Permalinks in the wordpress admin and clicking save changes. You wont need to make any changes so nothing in your site should be effected but this sometimes fixes problems with links when using custom post types (as the plugin does).

    Otherwise is this a theme that you are developing or had custom made? Could you tell me what templates it uses ie the files in the themes folder. In particular does it have an archive.php file and what other files are there?

    Thread Starter charlesalder

    (@charlesalder)

    Hi

    I had these permalinks, /%category%/%postname%, removed them and went to http://www.talkingeducation.com.au/2011/08/09/sample-post/ but this did not fix the issue

    Plugin Author trevorpythag

    (@trevorpythag)

    I’m not sure what could be causing the permalink issues. Have you had issues with the permalinks of your other posts and pages on the site?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Display on Categories under which Questions can be asked’ is closed to new replies.