We want our plugin to provide a default archive template for the FAQ post type. This archive will group the FAQs by their topic and provide the HTML structure for each FAQ. We can’t expect theme developers or customizers to build this template for us. That’s not a reasonable expectation. Instead, we need to build the template and then serve it up. But WordPress does not serve templates from plugins out-of-the-box. Therefore, we will need to write the code to tell WordPress: “Hey, load this template please.” We’ll want to provide the means for the theme to override when it […]
In this quick tip, you will see that you can specify a default return value for the WordPress function get_option(). When the option does not exist in the database, such as you are setting up a theme options page, then you can specify a return value as the default. Otherwise, you will get “false” back.