Support » Plugin: FAQ Manager » [Plugin: FAQ Manager] Using own templates for single/archive?

  • Resolved ben4d85

    (@ben4d85)


    Hello,

    • I would like to have an individual “category”-page for each topic. These pages should be located under …/faq/mycategoryname and should use my own template (I’ve tried archive-question.php but that doesn’t work).
      They currently are located under ../posts/topics/mycategoryname and use the default template (archive.php). How can I change that behaviour?
    • I would also like to have an individual “post”-page for each question. These pages should be located under …/faq/myquestionname. They currently are located under ../posts/question/myquestionname.. How can I change that behaviour?

    I mainly want to do this such that I can have a whole faq-section on my page that has its own headings, descriptions, sidebars (using your widgets).

    I have tried using the “Make individual FAQ entries public”-option and have entered “faq” as the slug, however that doesn’t help.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Andrew Norcross

    (@norcross)

    If you want to use your own templates, then you need to follow the template hierarchy and create the files in your theme using the proper syntax. The post type is question, so that is what you’d use.

    No custom post type will allow you to have domain.com/post without a lot of overhauling and manual functions in the permalink rewrite functions. This isn’t anything I am going to include in the plugin.

    Thread Starter ben4d85

    (@ben4d85)

    No custom post type will allow you to have domain.com/post without a lot of overhauling and manual functions in the permalink rewrite functions.

    The following should be possible with the code listed below.

    I would also like to have an individual “post”-page for each question. These pages should be located under …/faq/myquestionname. They currently are located under ../posts/question/myquestionname.. How can I change that behaviour?

    When you create the custom post type, just do:

    function create_post_type() {
    	register_post_type( '...',
    		array(
    			...,
    			'rewrite' => array(
    			     'slug' => 'faq', // set slug to "faq"
    			     'with_front' => 0 // get rid of the "posts/" in url
    			),
    			...
    		)
    	);
    }

    and that should give you: http://www.myblog.com/faq/myquestionname. I haven’t tried to include it into your plugin yet, but I just did it for one of my own custom post types and there it works like a charm ;). Don’t you think it makes more sense this way, or why would one want the additonal “posts/” in the url?

    Plugin Contributor Andrew Norcross

    (@norcross)

    Having the word “post” in the slug isn’t coming from the plugin, rather, your own permalink structure. Depending how what your structure is, it should be domain.com/question/the-slug-of-the-faq. I won’t be changing how that area acts because

    • It would break established links on sites already running the plugin
    • many people use the shortcode output on a single page called “faq” which would no longer be functional if I changed it to FAQ

    Hello Norcross, thank you for a great plugin!

    How would I change the “question” slug of the URL to something else? I don’t mind that you used “question” but my blog is in a different language and this doesn’t help at all.

    Also, the option “Desired page slug for archiving (all lower case, no capitals or spaces)” — what does this do?

    Thanks!

    Plugin Contributor Andrew Norcross

    (@norcross)

    In a future release (possibly the next one) I plan on adding the ability to change the default URL slug from “question” to something else.

    The archiving function is something that was released in WP 3.1, which allows you to declare the “archive” slug. By default, it is the same as the post type (question) but it can be made into something else.

    I am using the Weaver theme in combination with FAQ Manager. Any idea how I can change the template for the single question page?
    It now uses the ‘standard’ template and displays all(!) my widgets on the right hand side. I would like to use another template for the single question page(for instance without any widget area).

    Plugin Contributor Andrew Norcross

    (@norcross)

    Sorry, I’m not familiar with the Weaver theme. A single question should use your “single.php” file (or the Weaver equivalent). I would check with them.

    thanks for your reply.
    i’ve continued searching for a solution myself and found an option in the Weaver theme where you can turn off the widget-areas for single posts. Problem solved!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: FAQ Manager] Using own templates for single/archive?’ is closed to new replies.