Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter yp

    (@yp)

    Anyone?

    Thread Starter yp

    (@yp)

    Any other suggestions anyone? I just “know” that this can’t be impossible… After all, it’s WordPress 🙂

    Thread Starter yp

    (@yp)

    You mean like this?

    <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post();
     if ( (is_single()) and (is_author('2')) ) {
     include(TEMPLATEPATH . '/single_ole.php');
    } elseif ( (is_single()) and (is_author('3')) ) {
    include(TEMPLATEPATH . '/single_melissa.php');
    } elseif ( (is_single()) and (is_author('4')) ) {
    include(TEMPLATEPATH . '/single_camilla.php');
     } else {
     include(TEMPLATEPATH . '/single_original.php');
    } ?>

    It didn’t work. Only got a “Parse error”-message. And yes, I removed the same code from the other single.php-files…

    Thread Starter yp

    (@yp)

    Yes, it does… It’s part of a longer code:

    <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?>

    Should I just remove the “the_post()” part or more?

    Thread Starter yp

    (@yp)

    Hi alanft,

    Thanks…
    Based on what you said I tried this code:

    <?php the_post();
     if ( (is_single()) and (is_author('2')) ) {
     include(TEMPLATEPATH . '/single_ole.php');
    } elseif ( (is_single()) and (is_author('3')) ) {
    include(TEMPLATEPATH . '/single_melissa.php');
    } elseif ( (is_single()) and (is_author('4')) ) {
    include(TEMPLATEPATH . '/single_camilla.php');
     } else {
     include(TEMPLATEPATH . '/single_original.php');
    } ?>

    Is this what you meant? It didn’t work though. There were no “fatal errors” but the post itself was missing. Only the bottom of the page, the footer and that stuff, were showing.

    I got the feeling I was close, if I just could get the post to show, maybe it would work? Any suggestions anyone?

    Thread Starter yp

    (@yp)

    Thank you, cais!

    I tried your version but unfortunately the result was the same as the other code.

    This really seems like it isn’t “meant to be”… if anyone has other suggestions, please let me know. Or else I’m ending up with doing the category-version, which I really hoped to avoid…

    Thread Starter yp

    (@yp)

    Hi Yakuphan,

    I really appreciate the help, but could you please explain a little closer… I didn’t quite understand what the actual code should look like.

    Here’s the code that didn’t work:

    <?php $post = $wp_query->post;
     if (is_author('2')) {
     include(TEMPLATEPATH . '/single_ole.php');
    } elseif (is_author('3')) {
    include(TEMPLATEPATH . '/single_melissa.php');
    } elseif (is_author('4')) {
    include(TEMPLATEPATH . '/single_camilla.php');
     } else {
     include(TEMPLATEPATH . '/single_original.php');
    } ?>

    Could you please point me in the direction of what this should look like? I’m new to all of this.. 🙂

Viewing 7 replies - 1 through 7 (of 7 total)