WordPress.org

Ready to get started?Download WordPress

Forums

WP Awesome FAQ Plugin
Code Categories (16 posts)

  1. mikaelamaria
    Member
    Posted 5 months ago #

    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/

  2. JeremyCh
    Member
    Posted 3 months ago #

    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.

  3. madmottscott
    Member
    Posted 3 months ago #

    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

  4. Catherine
    Member
    Posted 2 months ago #

    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

  5. madmottscott
    Member
    Posted 2 months ago #

    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

  6. Catherine
    Member
    Posted 2 months ago #

    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/

    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

  7. madmottscott
    Member
    Posted 2 months ago #

    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

  8. Catherine
    Member
    Posted 2 months ago #

    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

  9. wpatch
    Member
    Posted 2 months ago #

    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?

  10. evandroguedes
    Member
    Posted 2 months ago #

    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' ) );

    =)

  11. wpatch
    Member
    Posted 2 months ago #

    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

    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/

  12. evandroguedes
    Member
    Posted 2 months ago #

    Hi wpatch,

    On the line 87 change this:


    function h2cweb_accordion_shortcode() {

    for:


    function h2cweb_accordion_shortcode($atts) {

    =)

  13. wpatch
    Member
    Posted 2 months ago #

    That did it!

    Thanks for the help!

    wp

  14. Catherine
    Member
    Posted 2 months ago #

    thanks but now the FAQ is gone from the product... ?
    http://victorybox.org/product/illumination-box/

  15. x12media
    Member
    Posted 1 month ago #

    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.

  16. Catherine
    Member
    Posted 1 month ago #

    has anyone found a better plugin that is actually being monitored and supported by the developer?

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.