go41

Re: Different author.php depending on author ID :: Reply by adamwork

von Joern am 12. Jul. 2010 | Keine Kommentare

Hi joern
thanks for getting back, i’m slightly confused though.
What should I put in my main author.php? Currently I have:
Code:

<?php

    if(isset($_GET['author_name'])) :

        $curauth = get_userdatabylogin($author_name);

    else :

        $curauth = get_userdata(intval($author));

    endif;

    ?>
   <?php if (have_posts()) : ?>
    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>

(von: adamwork)

Hier noch 4 weitere Ergebnisse dieses Threads:

Different author.php depending on author ID

12. Jul. 2010 (von: adamwork)

Similar to the way you can select which version of single.php appears, depending on the category, is there anyway to select a different author.php, depending on the author ID?Was thinking about using something similar to this, but adapting for author…

Re: Different author.php depending on author ID :: Reply by Joern

12. Jul. 2010 (von: Joern)

it's easier, similar to category-4.php you can use:author-{id}.php - If the author's ID were 4, WordPress would look for author-4.phpsee here:http://codex.wordpress.org/Author_Templates____________________you find me on Google+, Twitter and Facebook Weiterlesen →

Re: Different author.php depending on author ID :: Reply by adamwork

12. Jul. 2010 (von: adamwork)

Sorry Joern, I've just re-read and think I understand now!! I basically just need to create different author.php files and call them:author-4.php and author-5.php etc etc... Weiterlesen →

Re: Different author.php depending on author ID :: Reply by Joern

12. Jul. 2010 (von: Joern)

right, no switch required!just try it with any author ID, a copy of your original author.php and something changed to see which file wordpress takes.____________________you find me on Google+, Twitter and Facebook Weiterlesen →

Autor:

Du findest mich auch auf Twitter und Facebook!

Schreibe einen Kommentar

Pflichtfelder sind mit * markiert.


Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.

weitere forum Beiträge: