Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Post-Kicker, -Byline & -Footer »

[SOLVED] How to Add Author Description to Page generated by "%author-posts-link%"


  #1  
Old Dec 15, 2010, 02:45 AM
Steve41
 
10 posts · Dec 2010
In my old theme, when you clicked on the Author's name in the byline, that took you to an "authors page" that had at the top the bio for the author and then a list of their posts. Not sure how I can do this with this theme. Any help appreciated.

The code in the old theme to grab the 'user_description' was:
PHP Code:
<?php
if(get_query_var('author_name')) :
    
$curauth get_user_by('slug'get_query_var('author_name'));
else :
    
$curauth get_userdata(get_query_var('author'));
endif;
?>

<h3>About<?php echo $curauth->nickname?></h3>
    <dl>
        <dt>Website</dt>
        <dd><a href="<?php echo $curauth->user_url?>"><?php echo $curauth->user_url?></a></dd>
        <dt>Profile</dt>
        <dd><?php echo $curauth->user_description?></dd>
    </dl>
  <h3>Posts by <?php echo $curauth->nickname?>:</h3>

    <ul>



        <?php if (have_posts()) : ?>

       <?php $post $posts[0]; // Hack. Set $post so that the_date() works. ?>
       <?php /* If this is a category archive */ if (is_category()) { ?>
        <h3 class="pagetitle">Archive for the ‘<?php single_cat_title(); ?>’ Category</h3>
       <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
        <h3 class="pagetitle">Posts Tagged ‘<?php single_tag_title(); ?>’</h3>
       <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
        <h3 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h3>
       <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
        <h3 class="pagetitle">Archive for <?php the_time('F, Y'); ?></h3>
       <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
        <h3 class="pagetitle">Archive for <?php the_time('Y'); ?></h3>
      <?php /* If this is an author archive */ } elseif (is_author()) { ?>
        <h3 class="pagetitle">Author Archive</h3>
       <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
        <h3 class="pagetitle">Blog Archives</h3>
       <?php ?>

        <?php while (have_posts()) : the_post(); ?>
Appreciate any help on this please
  #2  
Old Dec 15, 2010, 04:20 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
this will give you part of it. Add the following to the bottom of ATO->Style & edit CENTER COLUMN->Content ABOVE the LOOP
HTML Code:
<?php if (is_author()) { ?>
<h3>About: <?php the_author(); ?></h3> 
    <dl> 
        <dt>Website</dt> 
        <dd> <?php the_author_link(); ?></dd> 
        <dt>Profile</dt> 
        <dd><?php the_author_meta('description'); ?></dd> 
    </dl> 
  <h3>Posts by <?php the_author(); ?>:</h3> 

<?php }; ?>
this will not break it down by archive/category etc, but it will list the posts
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Dec 15, 2010, 02:28 PM
Steve41
 
10 posts · Dec 2010
Thanks for that, it didn't work as posted (didn't retrieve any data), but it gave me the idea how to fix it. Not elegant, but then I'm not a programmer
Solution:
PHP Code:
<?php
if(is_author()) {
if(
get_query_var('author_name')) :
    
$curauth get_user_by('slug'get_query_var('author_name'));
else :
    
$curauth get_userdata(get_query_var('author'));
endif;
echo 
'About:'.$curauth->nickname;
echo 
'<dl><dt>Website</dt><dd><a href="'.$curauth->user_url.'">'.$curauth->user_url.'</a></dd>';
echo 
'<dt>Profile</dt><dd>'.$curauth->user_description.'</dd></dl>';
 } 
 
?>
  #4  
Old Dec 15, 2010, 03:46 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
odd, it works fine for me - might be a release issue, but if your version works great.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I add a "Back to top" link on the site? lmilesw Tips 0 Oct 25, 2010 12:52 PM
Styling %author% and %author-posts-link% Aris Post-Kicker, -Byline & -Footer 2 Jul 6, 2010 10:34 PM
[SOLVED] How to add additional link beside the &quot;home&quot; page above logo? cordi Other BFA WordPress Themes 2 Apr 8, 2010 11:21 AM
%author-linked% and "All posts by this author" David Latapie Post-Kicker, -Byline & -Footer 2 Nov 1, 2009 06:53 PM
[SOLVED] How to apply &quot;strong&quot; to the comments author name? wmoura Comments, trackbacks & pings 2 Jun 16, 2009 04:05 AM


All times are GMT -6. The time now is 08:05 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.