Results 1 to 2 of 2

Thread: Help Urgently Needed " Authors Page "

  1. #1
    Thread Starter
    Veteran chriswareham's Avatar
    Join Date
    Apr 2012
    Location
    Staffordshire, UK
    Posts
    296
    Thanks
    18
    Thanked 40 Times in 38 Posts

    Help Urgently Needed " Authors Page "

    Hi all i have found a piece of code that i would need to display posts from a specific user, when i implement the code none of the authors data is pulled out. is there a way of modifying the code below so i can set it to display posts from user ID 1
    my site is live and i have been trying for weeks to figure a way to display these posts in a page your help would be appreciated
    thanks Chris
    <?php
    /*
    Template Name: Shops
    */



    if ( isset($_GET['author_name']) ) :
    $curauth = get_userdatabylogin($author_name);
    else :
    $curauth = get_userdata( intval($author) );
    endif;

    ?>

    <?php get_header(); ?>

    <div class="content">

    <div class="content_botbg">

    <div class="content_res">

    <div id="breadcrumb">

    <?php if ( function_exists('cp_breadcrumb') ) cp_breadcrumb(); ?>

    </div>

    <!-- left block -->
    <div class="content_left">

    <div class="shadowblock_out">

    <div class="shadowblock">

    <h1 class="single dotted"><?php echo($curauth->display_name); ?><?php _e('\'s Profile','appthemes')?> </h1>

    <div class="post">

    <div id="user-photo"><?php appthemes_get_profile_pic($curauth->ID, $curauth->user_email, 96) ?></div>

    <div class="author-main">

    <ul class="author-info">

    <li><div class="dotted"><strong><?php _e('Member Since:','appthemes');?></strong> <?php echo date_i18n(get_option('date_format'), strtotime($curauth->user_registered)); ?></div></li>

    <li><div class="globeico"></div><?php if($userdata->user_url) { ?><a href="<?php echo $userdata->user_url; ?>" target="_blank"><?php echo $userdata->user_url; ?></a><?php } else { _e('N/A','appthemes'); } ?></li>

    <li><div class="twitterico"></div><?php if($userdata->twitter_id) { ?><a href="http://twitter.com/<?php echo $userdata->twitter_id; ?>" target="_blank"><?php _e('Twitter','appthemes')?></a><?php } else { _e('N/A','appthemes'); } ?></li>

    <li><div class="facebookico"></div><?php if($userdata->facebook_id) { ?><a href="http://facebook.com/<?php echo $userdata->facebook_id; ?>" target="_blank"><?php _e('Facebook','appthemes')?></a><?php } else { _e('N/A','appthemes'); } ?></li>

    </ul>

    </div>

    <h3 class="dotted"><?php _e('Description:','appthemes'); ?></h3>
    <p><?php if($curauth->user_description) { ?><?php echo $curauth->user_description; ?><?php } else { _e('N/A','appthemes'); } ?></p>

    <div class="pad10"></div>

    <div class="addthis_toolbox addthis_default_style">
    <a class="addthis_button_facebook"></a>
    <a class="addthis_button_twitter"></a>
    <a class="addthis_button_email"></a>
    <a class="addthis_button_print"></a>
    <a href="http://addthis.com/bookmark.php?v=250" class="addthis_button_compact"></a>
    <a class="addthis_button_facebook_like"></a>
    </div>

    </p>

    <h3 class="dotted"><?php _e('All Items Listed by','appthemes')?> <?php echo($curauth->display_name); ?><?php _e(':','appthemes')?></h3>

    </div><!--/directory-->

    </div><!-- /shadowblock-flush -->

    </div><!-- /shadowblock_out-flush -->

    <!-- author ads -->

    <?php
    // show only ads from this author
    $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
    query_posts( array('post_type' => 'ad_listing', 'post_status' => 'publish', 'author' => $curauth->ID, 'paged' => $paged) );
    ?>

    <?php get_template_part( 'loop', 'ad_listing' ); ?>

    </div><!-- /content_left -->

    <?php get_sidebar(); ?>

    <div class="clr"></div>

    </div><!-- /content_res -->

    </div><!-- /content_botbg -->

    </div><!-- /content -->

    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#"></script>

    <?php get_footer(); ?>

  2. #2
    Veteran barukar's Avatar
    Join Date
    Sep 2010
    Location
    Brasil, São Paulo, SP
    Posts
    6,784
    Thanks
    186
    Thanked 742 Times in 623 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    -------------------------------------------------------------------------------------------
    Projects: ClassiNoiva - Classimóveis - vocênoenem - i50 - Clube DETRAN

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Multiple "Authors" for One Ad
    By kristopherk in forum ClassiPress General Discussion
    Replies: 3
    Last Post: October 2nd, 2011, 12:39 AM
  2. Essential built-in "Custom Field" feature Needed Urgently!
    By royalstar in forum Report ClassiPress Bugs
    Replies: 11
    Last Post: March 29th, 2011, 05:07 PM
  3. [SOLVED] "404 Not Found" page when attempting to "post an ad" or "join now"
    By tradingpoint in forum Report ClassiPress Bugs
    Replies: 3
    Last Post: March 21st, 2011, 07:51 PM
  4. Replies: 6
    Last Post: October 2nd, 2010, 10:50 AM