Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Showing number / count of tags in 1.5 (quick tutorial)

+4 votes
185 views
asked Apr 1, 2012 in Q2A Core by Aslan

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
commented Apr 1, 2012 by Merkus
thanks for that.
commented Nov 23, 2012 by BeenYoung
Thanks men! :)

Please log in or register to answer this question.

...