Plugin Directory

Changeset 459228


Ignore:
Timestamp:
11/03/2011 10:25:45 PM (14 years ago)
Author:
rfrankel
Message:

Added a shortcode to display a single category of the FAQ. [wp_super_faq show_specific_category=slug]

Location:
wp-super-faq/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-super-faq/trunk/readme.txt

    r459156 r459228  
    55Requires at least: 3.1
    66Tested up to: 3.2.1
    7 Stable tag: 0.3
     7Stable tag: 0.4
    88
    99A lightweight FAQ/QNA plugin that includes an FAQ shortcode for your site. A simple jQuery animation is included to show/hide each question.
     
    3434== Frequently Asked Questions ==
    3535
    36 = What a re the possible shortcodes for WP Super FAQ =
     36= What are the possible shortcodes for WP Super FAQ =
    3737* The most basic usage is simply `[wp_super_faq]`.  By default WP Super FAQ will not display the questions by category. 
    3838* If you would like to display your questions by category you can use `[wp_super_faq show_categories=true]`.  This will display a header for each category and place the relevant questions in each section.
     39* If you would like to display a SINGLE category you can use `[wp_super_faq show_specific_category=slug]` where slug is the SLUG of the category you would like to display.  The slug can be found by clicking on `FAQ Categories` in the admin area.
    3940
    4041= Can I use this in PHP instead of a shortcode? =
     
    5152== Changelog ==
    5253
     54= 0.4 =
     55Added a shortcode to display a single category of the FAQ. `[wp_super_faq show_specific_category=slug]`
     56
    5357= 0.3 =
    5458Added a fix that makes sure that the FAQ shows all of the questions regardless of what is set under Settings > Readings.
     
    6165
    6266== Upgrade Notice ==
     67= 0.4 =
     68Added new shortcode for showing a single category.
     69
    6370= 0.3 =
    6471Minor update.  You should upgrade to stay up-to-date.  This bug will affect some of you that are using the 'Show At Most' feature of WordPress.
  • wp-super-faq/trunk/wp_super_faq.php

    r459156 r459228  
    44Plugin URI: http://plugins.swampedpublishing.com/wp-super-faq
    55Description: A lightweight Wordpress Plugin that implements an FAQ page on your site using simple jQuery animation for a clean, usable interface.
    6 Version: 0.3
     6Version: 0.4
    77Author: rfrankel
    88Author URI: http://plugins.swampedpublishing.com/
     
    144144    extract( shortcode_atts( array(
    145145        'show_categories' => false,
     146        'show_specific_category' => false,
    146147    ), $atts ) );
    147148   
     
    179180        }
    180181    } else {
    181         // Custom Loop
    182         $wp_super_faq_query = new WP_Query( array( 'post_type' => 'wp_super_faq' ) );
     182        if ( $show_specific_category ) {
     183            $wp_super_faq_query = new WP_Query( "taxonomy=wp_super_faq_category&term=$show_specific_category&posts_per_page=-1"  );
     184        } else {
     185            $wp_super_faq_query = new WP_Query( array( 'post_type' => 'wp_super_faq', 'posts_per_page' => '-1', ) );
     186        }
     187       
    183188        // The Loop
    184189        while ($wp_super_faq_query->have_posts()) : $wp_super_faq_query->the_post();
Note: See TracChangeset for help on using the changeset viewer.