Support » Themes and Templates » Curauth data in custom template

  • I can get this information easy from the author template. If a copy the author template and rename to mytemplate, the curauthor no longer works..

    What do I have to do to get the $curauth data in a custom template ?

    <?php /* Template Name: MyTemplate */ ?>
    <?php get_header(); ?>

    // Code here //
    <?php echo $curauth->display_name; ?>

    <?php get_footer(); ?>

    I’ve searched and tried all the standard codes but I seem to be missing something :
    This currently works ok in author template, as does the other three versions of this code.
    <?php global $wpdb, $wp_query; $curauth = $wp_query->get_queried_object(); ?>

    They just don’t work in a custom template and its driving me crazy..

  • The topic ‘Curauth data in custom template’ is closed to new replies.