Support » Plugin: Q and A FAQ and Knowledge Base for WordPress » [Plugin: Q and A – FAQ Plugin] Category Description

  • WP 3.1
    Q&A: 0.2.1


    Thank you for an awesome plugin. I have just been styling my Q&A pages and doing some modding.

    I really wanted to take advantage of the Category Description when outputting my Q&A’s.

    This is not the most efficient hack but it does the job. There are to many calls to the DB for a small amount of info, and I’m sure there must be a more efficient way to do this.

    File: q-and-a.php

    global $wpdb; $catname = $wpdb->get_var("SELECT name FROM $wpdb->terms WHERE slug = '$cat'");
    		$catnameid = $wpdb->get_var("SELECT term_id FROM $wpdb->terms WHERE slug = '$cat'");
    		$catdesc = $wpdb->get_var("SELECT description FROM $wpdb->term_taxonomy WHERE term_id = '$catnameid'");
    		if (!empty($cat)) {$qa_shortcode .= '<p class="faq-catname">'.$catname.'<br><span class="faq-catdesc">'.$catdesc.'</span></p>';}

    I have called out the description and then added some HTML/CSS to place it and style it.

    It would be great if this feature was added to the plugin.
    (With more efficient code 😉

    HTH others too,

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Q and A – FAQ Plugin] Category Description’ is closed to new replies.