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
- Disable plugin / plugin action via theme
- How Do I Use The WordPress Plugin Posts 2 Posts by Scribu?
- Need to create a Theme demo site that features multiple themes
- Why does including a file in theme’s functions.php not work?
- Adding New Role
- Publish Post After Click On A Link
- Add Top-Level Menu that opens URL
- Enable comments for post with comments meta box removed
- Is there an action that is called when a post is restored from the trash?
- wordpress custom login successful redirect hook
- plugin for wp_list_categories with posts
- WordPress ajax call for not logged in users, doesn’t work
- Replace existing pages with new pages, keep menu links
- Display All Non-Used Plugins
- Adding “ ” before the last word in multiple defined areas with a plugin
- New Plugin: Post update pushes a copy as a revision
- How to change ID of an attachment in wp_posts and its related tables correctly?
- Placement of Code in Plugin for hooking `save_post`
- New post notification plugin [closed]
- Adding Plugin-specific Fields with wp_insert_post()?
- Avoiding Duplicate function names in Post Loop (WP_Footer script)
- How to add class in plugin only for network site?
- PHP Fatal error: Call to undefined function plugin_basename
- Executing my function once on a specific time
- Missing Argument
- load_plugin_textdomain error
- Cron job not firing
- Adding Shortcode to Text Widget
- Does WordPress validate inputs to all functions? (such as get_user_meta and insert_user_meta)
- Can’t delete Draft Post [closed]
- Outbound link autometic converted into linkdirect , and not opening
- Modifying Author Link to add Author Meta in URL
- Contributive page where people logged in can write
- WP Query. Is there a maximum size?
- Difference and examples of esc_attr__() and esc_attr_e()
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- Recent posts per category loop?
- How to prevent additional code in functions.php to be removed once there is an update?
- Problem of encoding characters (apostrophes) in my posts publications
- How to backup single post in wordpress [closed]
- Proper way to use plugin functions in functions.php
- Allowing users to Sign-up > Login > Post articles that need approval
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- Woocommerce singe product custom gallery output works just on the first slide
- Is there a plugin or a way in the wordpress that would let us have different versions of a post or page accessibe to users?
- download button for audio file in post [closed]
- Print posts category or tag as a formatted journal
- How to translate wordpress error message
- strange shortcode error: does shortcodes requires any dependency?
- All custom widgets are not showing in widget area at the same time
- Send post changes to set email addresses (not users or subscribers)
- Post deleted in trash [closed]
- How to relate 3 wordpress components with each other (Create database relationships)
- problem with register_activation_hook in plugin
- How can i listing current category and Featured Category post list?
- How to add custom function to pluggable.php
- grab or load text on demand
- How to get Recent Post From Each Category with Thumbnail?
- sliding/fading header plugin or approach suggestion
- Why the internal link get converted into a comment?
- How would I get the new plugin version on this function?
- Copy/paste local images not working in WordPress
- How to change my 3000 Published post status to Draft using PHPMyAdmin
- How to display ACF coustom field from category on author.php
- Search in WordPress
- Modify function output in a plugin
- All Post WordPress Page Error
- Is admin section completely customizable in terms of styling?
- Is it possible to create duplicate post on other site (either push, on publish, or pull, periodically)?
- How to make the first letter of a post title uppercase, in a plugin?
- Migrating custom php we wrote from functions.php into a site-specific plugin
- Add dynamic color to each category item
- Is there any hook to change media html in post? [duplicate]
- Code fails in plugin file but works in functions.php
- Conditional required fields for WordPress Contact Form 7
- Publish Post but don’t call publish hook in foreground post creation
- Cannot access variables within a widget
- WordPress plugin options need to delete after deactivate & uninstall
- WordPress function to add text
- Doing action based on input from options menu
- Notify Author of the post if admin deletes his post and perform some function
- Want to add post to user dashboard
- Shortcode returning specific content of a post
- Make plugin admin page visible to other roles
- Getting 400 Error in wordpress website