You can do the following:
<?php
$post = $wp_query->post;
$options = get_option( 'sample_theme_options' );
$authors = explode( ',', $options['sometext'] );
if ( is_author( $authors ) ) {
include ( TEMPLATEPATH . '/brand.php' );
} else {
include ( TEMPLATEPATH . '/customauthor.php' );
}
?>
This way, you’re always sure that $authors
contains an array.
Related Posts:
- Manually set global $post vars with an ID, in order to use template tags
- Publish author posts only with editor approval?
- Limit access to posts/pages by user roles
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- Set a User as Author of all ‘New Posts’ posted
- Change destination author link
- Display post lists in 2nd paragraph
- Redirect to another page using contact form 7? [closed]
- Where Should i write the code for wordpress ajax voting?
- How can i list random author?
- How to wrap image tag into div for post only?
- How to prevent authors from editing their post count?
- Displaying friend’s posts only
- Notifications Bar on home page only
- Show WooCommerce products based on query parameters on redirect
- Import posts from a different database with the same old id
- Is there a way to order posts and custom post types as one group?
- I have functions in my wordpress plugin. How do I get them to work for me?
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- Execute a plugin only on post pages
- How can i list random post from multiple category?
- How to create TEMPORARY Download links in a wordpress POST?
- Conditionally add apt. Open Graph meta data to different pages on WordPress site
- PHP Fatal error: Call to undefined function plugin_basename
- Support for simultaneous editing
- How to get 1 or 2 specific posts on top of my wordpress blog?
- Portfolio + Blog: multisite or plugin?
- plugin development: problem with functions
- add_query_arg not working
- Shortcode button dosent work for all posts. Work for first post only
- Is there a way I can find wordpress posts that don’t contain a word?
- Accessing post’s meta data based on user’s click of a post
- Prevent shortcode from being wrapped in tags
- AJAX button run function
- Dropdown menu on custom page with product to choose number of products per page
- Change wordpress current_time function to different timezone
- Inserting HTML tag with ACF into shortcode
- View Private Published Page with URL Code (no login required)
- With W3 Total Cache when I publish a post it does not appear in the homepage. Only if i purge all cache [closed]
- Executing my function once on a specific time
- How to append to title via functions.php for auto-posting plugin [duplicate]
- How to stop or remove an action being called inside a function of an extended class
- Missing Argument
- load_plugin_textdomain error
- How to override a plugin function wrapped in a class?
- Bootstrap Drop Down menu is not working
- Not getting author rank when using return
- How to Display a Plugin function (content) on frontpage using index.php
- The problem with WordPress Importer
- Cron job not firing
- Solutions to repost categories into multisite blogs?
- How to enable qTranslate languages tabs in custom plugin page
- How do I “get the next 10 posts after post_id == x”?
- Hiding posts – WP Hide Post not working
- wordpress plugin is not activating from widget
- Theme my Login plugin, how to update fields
- Edit Yoast SEO breadcrumbs output [closed]
- Adding Shortcode to Text Widget
- Date calculations from 2 custom fields
- submit posts by unregistered users in wordpress
- Calendar Solution: Handling upcoming Dates with Posts?
- get_post_type on post.php
- Is there an easy way to flag posts in the admin area?
- Snippets: is it better to add them in functions.php or make site-specific plugins?
- Does WordPress validate inputs to all functions? (such as get_user_meta and insert_user_meta)
- Custom random quote widget breaks when used in multiple sidebars
- finding whether request is for post, and post id
- Using a function to change favorites listing
- Any built-in function to associate a post to category through a plugin?
- How to hide some section in WordPress under Post
- How to debug error message: Cannot modify header information
- Using a post-signup hook to get user details
- Can’t delete Draft Post [closed]
- How to enable specific plugin only based around shop manager role?
- How to change constants in WordPress wp-config.php programmatically?
- Matching Chapters to a Custom posts [closed]
- Restrict media upload size by format
- How to use a class from another plugin
- Override Plugin Script Fucnction in WordPress
- WordPress comments not appearing in blog posts, likely because of Redux template. Could I fix this with a plugin that adds a comment form as a block? [closed]
- How to display custom sidebar in wordpress 5.5.2
- Custom post type – no layout section of Document tab, and no author choice
- Calling plugin function inside custom plugin for onclick event
- Show function to super admin
- WordPress display breadcrumbs using Yoast plugin [closed]
- Outbound link autometic converted into linkdirect , and not opening
- creating html reusable blocks via shortcodes
- Display by Category in Admin
- get current date + 90 days and checking every day
- Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags
- Adding a new field to the address field type in gravity forms
- How to allow an editor to edit all WordPress blog posts but have the last say as administrator?
- Replacing a plugin function with a custom renamed function doesn’t work
- Modifying Author Link to add Author Meta in URL
- Two problems on my WordPress installation [closed]
- How to create an input field, and base the output on spreadsheet data? [closed]
- posts comments goes to trash
- Facebook Messager Plugin
- Contributive page where people logged in can write
- Nested shortcode functions accessing variable