yp
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Notify comment author when comment is approved?Anyone?
Forum: Fixing WordPress
In reply to: Showing different single.php’s based on authors?Any other suggestions anyone? I just “know” that this can’t be impossible… After all, it’s WordPress 🙂
Forum: Fixing WordPress
In reply to: Showing different single.php’s based on authors?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…
Forum: Fixing WordPress
In reply to: Showing different single.php’s based on authors?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?
Forum: Fixing WordPress
In reply to: Showing different single.php’s based on authors?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?
Forum: Fixing WordPress
In reply to: Showing different single.php’s based on authors?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…
Forum: Fixing WordPress
In reply to: Showing different single.php’s based on authors?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.. 🙂