Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
787 views
in Q2A Core by
My site running Question2Answer has gotten kinda popular. Right now it is joke questions that are inane. But I want to add a serious section to it.

I was thinking anything tagged with "serious" would to not be displayed on the frontpage and only visible when you visit the page for that tag. I already have a tab that links to the questions marked "serious".


I hope that made sense. And I know this is a serious edge case. Feel free to tell me to walk off a plank. I will understand.

1 Answer

+3 votes
by
 
Best answer
This is indeed an edge case, but you never know who else might find it useful! You need to insert the following code in qa-page-home.php:

    $tagtohide='serious';
   
    foreach ($questions as $index => $question)
        if (array_search($tagtohide, explode(',', $question['tags']))!==false)
            unset($questions[$index]);

Insert it before this line:

    $questions=qa_any_sort_and_dedupe($questions);

That will hide questions tagged 'serious' from the home page, questions page, unanswered page, and (non-linked) answers and comments pages. If you only want to apply the filter to certain pages, move that code up into the appropriate branch of the switch ($qa_template) {...} block.
by
This worked perfectly. Thank you so much. And how do we send you money? I don't see a button floating around.
by
Appreciate the offer, but there's really no need!
by
Fair enough. But your support is so much better than paid products. If I can't buy you a pint I will send a healthy "Fantastic Work" your way.
...