Title: Code Categories
Last modified: August 21, 2016

---

# Code Categories

 *  [mikaelamaria](https://wordpress.org/support/users/mikaelamaria/)
 * (@mikaelamaria)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/code-categories/)
 * Hi, I have the latest version and now it works fine and I see all the questions.
   When I add the code [faq] I can instead put a code that gives me a certain category
   only? Or two categories?
 * [http://wordpress.org/plugins/wp-awesome-faq/](http://wordpress.org/plugins/wp-awesome-faq/)

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/code-categories/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/code-categories/page/2/?output_format=md)

 *  [JeremyCh](https://wordpress.org/support/users/jeremych/)
 * (@jeremych)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/code-categories/#post-4317363)
 * I wanted the same thing.
 * [faq cat=1] or [faq cat=1,5] would be great. That way we can filter things and
   have multiple faq pages on the same website.
 *  [madmottscott](https://wordpress.org/support/users/madmottscott/)
 * (@madmottscott)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/code-categories/#post-4317364)
 * Hi guys,
    I wanted to do the same thing, its a great plugin.
 * Here is how you can modify the shortcode function to have this capability:
    in/
   wp-content/plugins/wp-awesome-faq/index.php around line 87
 * After:
 *     ```
       function h2cweb_accordion_shortcode($atts) {
       	// Registering the scripts and style
       ```
   
 * ADD:
    `extract( shortcode_atts( array('theslug' => 'general-questions'), $atts,'
   faq' ) );`
 * Edit the following line that reads:
 *  `$args = array( 'posts_per_page' => 50, 'post_type' => 'faq', 'faq_cat'=>"$theslug",'
   order'=>'DESC');`
 * to read:
    `$args = array( 'posts_per_page' => 50, 'post_type' => 'faq', 'faq_cat'
   =>"$theslug", 'order'=>'DESC');`
 * Once you have edited those two lines, you can use the shortcode like this:
    [
   faq theslug=’YOURSLUG’] Where ‘YOURSLUG’ is the category slug.
 * Also, you can set the default slug in the line that you added first. My default
   slug in the example above is ‘general-questions’. This is the slug that will 
   be pulled if one isn’t specified in the short code.
 * Hope that helps!!
    -Scott
 *  [Cat](https://wordpress.org/support/users/catscholz74/)
 * (@catscholz74)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/code-categories/#post-4317366)
 * if I make this modification to the plugin, will it get lost in the next auto 
   update? Is the developer planning on adding this feature to the next release?
 * Thanks,
    -Cat
 *  [madmottscott](https://wordpress.org/support/users/madmottscott/)
 * (@madmottscott)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/code-categories/#post-4317367)
 * Hi Catherine,
    The modification would get overwritten if you updated the plugin.
   Not if you updated wordpress.
 * Plugins don’t tend to auto-update, its usually your choice, so you would be safe.
 * All that said, i’m not sure how active development is on this plugin, and if 
   it will be updated in the future.
 * Thanks!
    -Scott
 *  [Cat](https://wordpress.org/support/users/catscholz74/)
 * (@catscholz74)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/code-categories/#post-4317368)
 * Thanks Scott – I’ll be sure not to update this plugin. I made your mods and the
   FAQs are not showing on product pages – see this example:
 * [http://victorybox.org/product/victory-box/](http://victorybox.org/product/victory-box/)
 * I am using this code in the product short description:
    [faq theslug=victory-
   box]
 * and I’ve added this code to the index.php:
    // Registering the scripts and style
   extract( shortcode_atts( array(‘theslug’ => ‘about’), $atts, ‘faq’ ) );
 * // Getting FAQs from WordPress Awesome FAQ plugin’s Custom Post Type questions
   
   $args = array( ‘posts_per_page’ => 5, ‘post_type’ => ‘faq’, ‘faq_cat’=>”$theslug”,‘
   order’=>”DESC”); $query = new WP_Query( $args );
 * It’s pulling the default category, but not the one I created for the product.
   Am I missing something?
 * Thanks!
 * -Cat
 *  [madmottscott](https://wordpress.org/support/users/madmottscott/)
 * (@madmottscott)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/code-categories/#post-4317369)
 * Hi Cat,
    I don’t see anything that jumps out, except for quotes on your short
   code. Try changing that to `[faq theslug='victory-box']` and see if that helps.
 * Thanks!
    -Scott
 *  [Cat](https://wordpress.org/support/users/catscholz74/)
 * (@catscholz74)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/code-categories/#post-4317370)
 * thanks Scott – the product editor is not accepting the quotes – it changes them
   into:
    ' even though I put the code in the text editor (not the visual).
 * I wonder if there is a way to do this by category ID number without using quotes?
 * thanks so much,
 * -cat
 *  [wpatch](https://wordpress.org/support/users/wpatch/)
 * (@wpatch)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/code-categories/#post-4317373)
 * Catherine and Scott,
 * Same thing on this end…displaying the default category only. Short code is certainly
   right on my end (proper quotes).
 * Scott any chance we are missing a step?
 *  [evandroguedes](https://wordpress.org/support/users/evandroguedes/)
 * (@evandroguedes)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/code-categories/#post-4317374)
 * Hi Cat / wpatch,
 * I have the same issue here. Just remove the default slug from shortcode_atts()
   method:
 * Change that line:
    ` extract( shortcode_atts( array('theslug' => 'general-questions'),
   $atts, 'faq' ) );
 * To:
    ` extract( shortcode_atts( array('theslug' => ''), $atts, 'faq' ) );
 * =)
 *  [wpatch](https://wordpress.org/support/users/wpatch/)
 * (@wpatch)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/code-categories/#post-4317375)
 * Evan,
 * Thanks for the response…didn’t do it for me either. Still outputs all not the
   category trying to filter:
 * Here is my wp-awesome-faq/index.php
    [http://pastebin.com/5di24Vhp](http://pastebin.com/5di24Vhp)
 * I have three categories with slugs: appraisal – landlord – tenant
 * Short code: [faq theslug=’appraisal’] still out puts all: [http://welchgroup.net/index.php/appraisal-faq-new/](http://welchgroup.net/index.php/appraisal-faq-new/)
 *  [evandroguedes](https://wordpress.org/support/users/evandroguedes/)
 * (@evandroguedes)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/code-categories/#post-4317376)
 * Hi wpatch,
 * On the line 87 change this:
 * `
    function h2cweb_accordion_shortcode() {
 * for:
 * `
    function h2cweb_accordion_shortcode($atts) {
 * =)
 *  [wpatch](https://wordpress.org/support/users/wpatch/)
 * (@wpatch)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/code-categories/#post-4317377)
 * That did it!
 * Thanks for the help!
 * wp
 *  [Cat](https://wordpress.org/support/users/catscholz74/)
 * (@catscholz74)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/code-categories/#post-4317378)
 * thanks but now the FAQ is gone from the product… ?
    [http://victorybox.org/product/illumination-box/](http://victorybox.org/product/illumination-box/)
 *  [x12media](https://wordpress.org/support/users/x12media/)
 * (@x12media)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/code-categories/#post-4317379)
 * has anyone figured a way to remove the “category” name from each posting ??
 * say you have 4 categories, and 4 faqs in each, it will post the category name
   after each FAQ if you have them assigned to the CAT.
 *  [Cat](https://wordpress.org/support/users/catscholz74/)
 * (@catscholz74)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/code-categories/#post-4317380)
 * has anyone found a better plugin that is actually being monitored and supported
   by the developer?

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/code-categories/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/code-categories/page/2/?output_format=md)

The topic ‘Code Categories’ is closed to new replies.

 * ![](https://ps.w.org/wp-awesome-faq/assets/icon-256x256.png?rev=2323698)
 * [Master Accordion ( Former WP Awesome FAQ Plugin )](https://wordpress.org/plugins/wp-awesome-faq/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-awesome-faq/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-awesome-faq/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-awesome-faq/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-awesome-faq/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-awesome-faq/reviews/)

 * 16 replies
 * 8 participants
 * Last reply from: [albermontes](https://wordpress.org/support/users/albermontes/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/code-categories/page/2/#post-4317384)
 * Status: not resolved