• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Agent Profile for AgentPress Pro

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Agent Profile for AgentPress Pro

This topic is: not resolved

Tagged: Agentt Press, Author Profile

  • This topic has 0 replies, 1 voice, and was last updated 6 years, 9 months ago by Angelo.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • February 8, 2019 at 9:31 am #489420
    Angelo
    Member

    I have created an autor.php file for author profile, I use AgentPress Pro, the file shows the author-box, also shows only the author's listings (That is the idea, I don’t want to show the author posts)
    I would like to know if the code is correct, or if there is any way to improve it.
    I don`t know much about code, everything I do is looking for tutorials and experimenting, so I would like someone to value the code

    <?php get_header(); 
     
    if(isset($_GET['author_name'])) : 
    $curauth = get_userdatabylogin($author_name);
    else :
    $curauth = get_userdata(intval($author));
    endif;?>
    <section class="public-profile">
    <div class="author-box">
     <div class="avatar"><?php echo get_avatar( $curauth->user_email , '120'); ?></div>
        <h3 class="author-box-title"><?php echo $curauth->nickname; ?>:</h3>
        <p class="author-box-content"><?php echo $curauth->user_description; ?><br />
        <a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></p>
       </div></section>
    
    <!-- Show just listings from the author -->
    <?php $args = array(
        'post_type' => 'listing' ,
        'author' => get_queried_object_id(), // this will be the author ID on the author page
        'showposts' => 10
    );
    $custom_posts = new WP_Query( $args ); ?>
    <?php if ( $custom_posts->have_posts() ): ?>
        <div class="author-by"><h5>Proximos eventos de: <?php echo $curauth->nickname; ?></h5>
    <span class="dashicons dashicons-arrow-down-alt2"></span></div>
       <div class="flex-container"> <?php while ( $custom_posts->have_posts() ) : $custom_posts->the_post(); ?>
    <div class="author-listing-title">
        <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>">
    <?php the_title(); ?></a>
    
    </div>
        <?php endwhile; ?>
    <?php else: ?>
        <p><?php _e('User has no Listings'); ?></p>
    <?php endif; ?></div>
    <!--LOOP ENDS-->
    
    <?php get_footer(); ?>
    https://www.facebook.com/angeloaguilarq
  • Author
    Posts
Viewing 1 post (of 1 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble