ThemeShaper Forums » Thematic


Author link to archives not working correctly in Thematic

(4 posts)
  • Started 13 years ago by Lumiere
  • Latest reply from designgirl
  • This topic is not resolved


  1. I'm unsure whether Thematic was built this way, or if I've changed something inadvertently along the way, but the author hyperlink does not correctly link to the author archive, except when viewing a single post.

    Clicking on an author's name when in the main blog page or viewing a list of posts in the archive, for instance, links to ?author=0 (this just takes you back to the home page). Only when the author's name is displayed on a single post does it link to the author archive as it should.

    The following code in functions.php allows me to modify this easily, however ONLY on a single post:

    <div class="entry-meta">
    <span class="author vcard"><?php _e('By ', 'thematic') ?>ID, $authordata->user_nicename); ?>" title="<?php __('View all posts by ', 'thematic') . the_author(); ?>"><?php the_author() ?></span>
    <span class="meta-sep"> | </span>
    <span class="entry-date"><abbr class="published" title="<?php get_the_time('Y-m-d\TH:i:sO'); ?>"><?php the_time('F jS, Y') ?></abbr></span>
    </div><!-- .entry-meta -->

    Ideally, changes here would be uniform across all pages...

    I'm a PHP novice, and I suspect there's something I need to add/change here to remedy this. Any help is greatly appreciated!

    Posted 13 years ago #
  2. Hi Lumiere,

    I'm not exactly sure if I'm interpreting your issue correctly...but I managed to fix mine and they seem at least I hope this might be of some help.

    Like you I'm a PHP Novice, so like most of my code challenges I jagged this one too :-) I'm sure there's a less 'dirty' fix than this one...but this did the job for me.

    I only recently realised that the 'Author' links from my blog headers weren't going anywhere.

    I've been dickin' around for days just trying to find the code that creates the URL/s. Although I was going thru the Function.php files, I wasn't sure which one had the relevant code. Thanks to you I found it. :-)

    This is what I did:

    I had 2 different URLs pointing from apparently the same links (the Author Name Links in the respective Author VCards at the top of single posts and post archive pages).

    The archive link pointed to 'http://.../author', while the author link in the actual post page pointed to 'http://..../author/my name'. Neither of them linked to an existing page.

    So first I created a page called 'Author' and made it a sub-page of my 'About' page. You can see it here -

    Then I found the code in Line 188 of wp-content/themes/thematicfeaturesite/functions.php.

    The line used to read:

    <span class="author vcard"><?php _e('By ', 'thematic') ?>ID, $authordata->user_nicename); ?>" title="<?php __('View all posts by ', 'thematic') . the_author(); ?>"><?php the_author() ?></span>

    I removed this bit - $authordata->ID, - (it's about 1/3 of the way along).

    Now Line 188 looks like this:

    <span class="author vcard"><?php _e('By ', 'thematic') ?>user_nicename); ?>" title="<?php __('View all posts by ', 'thematic') . the_author(); ?>"><?php the_author() ?></span>

    Anyway, now both Author links point to the same Author page. That'll do me for now :-)


    Stephen G

    Posted 13 years ago #
  3. Thanks for your input Stephen.

    What you've suggested hasn't quite worked for me, but I think it's in the right direction. Contrary to my original post, there are actually two blocks of code in the Thematic Featuresite functions.php that defines the author link.

    This line of code is what I've deduced I need to modify is:

    <?php if ($post->post_type == 'post') { ?>
    		<div class="entry-meta">
              	<span class="author vcard"><?php _e('By ', 'thematic') ?><a class="url fn n" href="<?php get_author_link(true, $authordata->ID, $authordata->user_nicename); ?>" title="<?php __('View all posts by ', 'thematic') . the_author(); ?>"><?php the_author() ?></a></span>

    Specifically, <?php if ($post->post_type == 'post') { ?> seems to determine how the author link behaves on the blog's main page. The actual code between the entry-meta div is repeated exactly the same earlier in functions.php (used to define the author link within the leader on a single post), and this works, so I don't think it needs changing...

    Posted 13 years ago #
  4. designgirl

    I'm having the same difficulty as Lumiere. I want the author link on the main blog page to link to the author archive for that specific author. I'm seeing other Thematic sites that don't have this issue, so someone must have figured this out or there is a function elsewhere in the thematic template or in the WordPress backend that I need to change.

    Could someone who's theme author links are working correctly please post what they have in their child theme's function.php file regarding the above code?

    Posted 12 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.