Tangler Discussion Forums

Discuss

Topics

Click a Topicto start discussing

    How do I call a comparison table only for the current category and subcategories?  It works if I use the autoadd feature in the admin controls, but if I just call the function in php code (so I can put it where I want it on the category archives page) it includes all categories.  I could specify the specific category, but I would like it to be dynamic like the one that is automatically added in.

    2010-01-09 15:21:30.0

    It depends on what theme file you're editing and where in that theme file you're putting the function call.

    Within a post loop, you can use something like get_the_category. In a category template, there's probably a global variable defined by WordPress for which category is being displayed, maybe you can look through the $GLOBALS array.

    2010-01-11 23:14:22.0

    Here is what I did,

    <?php $your_new_variable=get_query_var('cat'); ?>

    <?php rs_comparison_table(5, '', $your_new_variable); ?>

    Good luck!

    2010-01-23 19:55:04.0
To send a message, Join Now (it's quick and free) or Sign In
Edit Topic
Delete Topic
Are you sure you want to delete the topic