Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
467 views
in Q2A Core by

The tutorial beneath will make you capable of accessing the count of tags in your theme.

------------------------------

Add this function:

    function qa_db_tag_count_qs_selectspec($tag)
    {
        return array(
            'columns' => array('tagcount'),
            'source' => '^words WHERE word=$',
            'arguments' => array($tag),
            'arrayvalue' => 'tagcount',
            'single' => true,
        );
    }

To qa-include/qa-db-selects.php

P.S. you don't need to paste the function above in qa-db-selects.php if you have version 1.4 of q2a. It's only for 1.5.

------------------------------

Then head over to your qa-theme.php file.

Use this code to get the count of any tag:

qa_db_single_select(qa_db_tag_count_qs_selectspec('Economy'))

In the example above, the tag is Economy.

------------------------------

Good luck everyone!
 

Q2A version: 1.5
by
thanks for that.
by
Thanks men! :)

Please log in or register to answer this question.

...