WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a options page and i use this code.

I want this, I add author id on sometext field (e.g 3,2,5,11 ) and my author.php redirect custom author page.

My author.php

<?php $post = $wp_query->post;
$options = get_option('sample_theme_options');
 if (is_author( array($options['sometext']) ) ) {
 include(TEMPLATEPATH . '/brand.php');
else { include (TEMPLATEPATH . '/customauthor.php');

Im adding Some Text field number like this 3,2,5,11

 <?php echo  $options['sometext']; ?>

And code Output: 3,2,5,11

But my author.php not working good. Just first id working other id not working.

How can i fix it?

share|improve this question
up vote 1 down vote accepted

You can do the following:


$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.

share|improve this answer
It worked. Thanks – Genxer Feb 7 '13 at 17:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.