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
- Get the last post ID
- Disabling post images for not logged in users
- Change get_current_user_id code to the author’s profile
- Add category selection to custom post type (plugin)
- Show author on every sub-page
- Plugin is a widget, but I want to call it in the head, can I?
- Cannot get wpdb data (Error in a simple fuction) [closed]
- wordpress content .php file in an iframe’s src in a wordpress post
- Help with WP Business Directory Manager Plugin?
- Return multiple values in a shortcode attribute
- get specific value of a array | PHP
- Loading a plugin’s js file from functions.php
- Woocommerce: limit user to see only the products he created
- OceanWP settings are missing from Add New Post [closed]
- Function added to hook “new_to_publish” not executing – custom plugin
- How to access OOP plugin function inside themes or other plugin
- Creating an admin meta box to save post as pending
- Custom Template for wordpress cpt plugin
- Display author box on just certain category posts?
- Different registration form for different roles
- Edit part of a post
- WordPress Stats Plugin: Display Post Views [closed]
- Can you echo PHP code from a variable?
- Defining the value of a variable before a function?
- How to get custom minimum price in Woocommerce
- Adding plugin editing capability for Author
- Dynamic URL Rewrite for Custom
- how to validate input field in wordpress generated with wpform plugin
- Help to Create a Simple Plugin to make a post
- how to show comments only author which send own posts in wordpress
- Error using wordpress functions inside a plugin class
- New posts are not showing up on my front page
- Randomize post (and page) IDs on generation
- Moving all wordpress posts from 50 websites to another website
- Share my WordPress plugin for updating how?
- The function called on the wp head hook becomes null
- Submitting form to PHP
- How to detect 404 url and make this link underline or change background color?
- working code, not working – Plugin Dev
- Powerpress upload a podcast without creating a post for it
- How use get_plugin_updates() function?
- how override a define
- add tags to wordpress post using REST API
- How to Unhook actions/filters in within Class in plugin
- How to make a page both “private” and “password protected”
- Failed to load resource: the server responded with a status of 500 () post.php
- How to disable/enable a plugin at a specific time
- Configuring default woo commerce login with modal popup
- How to upload PDF from Front-End and post automatically?
- Dynamically Modify s2member Options
- register_activation_hook doesn’t fire at all
- Get value from an input field and pass into update_meta_data as $meta_value
- My ajax request don´t work and return 0
- How can I add a custom checkbox / radio button on the admin theme options to display a CSS or other?
- How to delete posts older than one year with post meta, post attachments and files?
- Get content and send to 3rd party
- Is it possible to get a shortcode generated by a plugin, then, using a function, create a new post using that shortcode?
- Create csv file in plugin
- Different email notifications (about pending posts) to different users
- How to display single arbitrary facebook post with a shortcode?
- Custom post type request switches to media request
- Load wordpress enviroment for external content?
- How do add_action and WP_Query
- How to Batch Upload .docx Files as Posts
- How to structure plugin in to functions?
- WordPress ultra slow if I click on posts?
- Check if post was modified by editor different than post author
- Most visited posts
- How to disable register and reset the password from WordPress admin panel?
- wp_update_post does not change post status from draft to publish, returns 1
- Static page with formatted post list
- What is wrong with this dbDelta syntax?
- Call a function with href
- Automatically put a menu on every post
- Preset categories in wordpress by GET-paremters [duplicate]
- hide particular category post from front page only [closed]
- Adding a script & php to functions.php
- Override the plugin class and function
- Activate and deactivate two plugins automatically at certain hours
- Create WordPress category dynamically
- Redirect a specific User role not admins automatically to view the post that they just updated
- warning wp session
- How to add portfolio category post count in main navigation menu?
- What is the easiest way to create a custom field archive?
- Simple ajax request with Vanilla JS keeps given 400 Bad Request