Support » Plugin: Q and A FAQ and Knowledge Base for WordPress » [Plugin: Q and A – FAQ Plugin] link to faq question with answer displayed inline on shortcode page?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Dalton Rooney


    That would require some modifications to the plugin to support it. I will add it to the list of ideas for the future, thanks!


    until this is implemented, or I muster up the motivation to solve it myself, could you tell me what template is being used to display the single questions… and if I can remove the comments section and maybe add a link to the page I made with the shortcode to it.

    Plugin Author Dalton Rooney


    The default template for single custom post types is just single.php. You can create a specific template for FAQs by duplicating single.php and renaming it single-qa_faqs.php. Then you can edit that file all you want.


    I know that this is a bit old of a thread, but I had a similar need to be able to link directly to a specific FAQ question/answer combo within a ‘Q and A’ page generated by the shortcode. I came up with the following solution.

    Linking to Specific Questions & Answers

    Within the file q-and-a.php, I edited around line 125 FROM
    $qa_shortcode .= '<div class="faq-title"><a href="'.get_bloginfo('wpurl').'?qa_faqs='.$postslug.'">'.$title.'</a></div>';


    $qa_shortcode .= '<a id="'.$postslug.'"></a><div class="faq-title"><a href="'.get_bloginfo('wpurl').'?qa_faqs='.$postslug.'">'.$title.'</a></div>';

    The primary change being the addition of a named anchor with the code snippet of <a id="'.$postslug.'"></a>

    This creates a named anchor just before the “faq-title” div and will give that named anchor an ID of whatever the FAQ question’s slug is.

    Forcing Display/Visibility of the Answers

    To remove the need to click a question to show/hide its answer, you can use the following CSS. Keep in mind, however,that this applies to ALL answers (so they will all be showing). If you create a more specific class/ID restriction, you could limit that side effect. But, that particular answer will still show all the time — this isn’t a show/hide event based on linking (which would be ideal).

    div.faq-answer { display: block !important; }

    Hope this helps!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Q and A – FAQ Plugin] link to faq question with answer displayed inline on shortcode page?’ is closed to new replies.