Jump to content
Sign in to follow this  
tazzydemon

Classic author.php

Recommended Posts

tazzydemon

Sirs, I need an author bio page that conforms to the classic Wordpress author.php using this code http://codex.wordpress.org/Author_Templates#Sample_Template_File I tried first on platform free by putting the file in the root folder and it worked but of course the formatted was useless as it was not integrated into the template system. And thats all I want to do. Then I bought the pro version and was dismayed to see it not there at all. Many have written about this on these boards and been fobbed off with the same answers, either it is coming in the new version or simply use Post Author Info section - which of course is not the same. So how to make a file author.php in the template root do what it is supposed to: just show an author bio. This is a Wordpress standard and shoud be there. Julian

Share this post


Link to post
Share on other sites
Rob
Julian, I think there may be a simpler solution to this and some fundamental confusion. Let's clarify the latter before we get to the former. Platform provide you with template files located in wp-content/themes/platformpro in your WP installation. You have the ability to download one of those and customize it as you wish, then upload it to wp-content/themes/platformbase, thus it's not necessary for PlatformPro to have all the "usual suspects" one finds in themes. Remember, this is a platform, not a theme. Let's also make sure you have Platform Base activated as your child theme so we can do the solutions in the right place. Now for the issue of creating an author page. I'm not sure how many authors your site will have. So, I'll presume several, and that you want to have individual bio pages that list/link all the articles/posts written by that author. Let's try this a totally different and completely oblique way. Please grab http://wordpress.org/extend/plugins/custom-press/ and activate it. Do the usual settings thing but in this, I'd like you to create a custom taxonomy called "authors" (noting it must be in lower case). You can add "Authors" to the label field and "Author" for the 'single use' field. Make sure it is applied to Posts, Pages and Revisions. The rest are not necessary. Now, let's grab this http://wordpress.org/extend/plugins/tpg-get-posts/ and activate it. Create a blank page and select any template you wish from the ones in the drop down list on the right. Call the page "Authors". You do not need to name this authors.php. Write a blurb on that page talking about your authors generally. Use any photos or graphics you wish. Below that blurb and/or graphics, use the shortcode (in HTML mode) for the TPG Get Posts plugin specifying the new custom taxonomy you created... "Authors" (for which the slug should be "authors" in lower case). Save the page. Here's an example: [code][tpg_get_posts tag="tag1" numberposts=10 show_meta="false" orderby="post_date" post_entire="false" fields="post_title,post_excerpt" ][/code] Note: "tag1" is representative of a tag. You can also apply 'category="category1" where category1 is the category name. Make sure the category for authors is the broader one, and for specific authors, I'd suggest using their tag. Now take a look under "Posts" on the left side. You'll find the word "Authors" linked there on your WP admin dashboard. Click it. Add a new "category" for every author you have. Let WP create the slug... just make a little note of it on a scratchpad. Save each new category. Go to Pages. Create a new page with your author's name. Let's call him John Doe. When you're in the John Doe page, add any photo, bio or other info you'd like. Below it, again, in HTML mode, add the shortcode again for TPG Get Posts for that author's tag or category. Save that. Repeat it for each one of your authors. Make sure to create specific keywords (tags) for the author. If your site's menu is going to have a list of the authors on the menu, all you need do is go to Appearances > Menus and select/add the author pages in the hierarchy you would like. Voila! You now have an automated author section with customized bio pages (which are actually better in some ways that other themes customized author pages. If you don't like the styling of the TPG Get Posts plugin, we can later provide you with a hook or, use other Platform components to give you a different appearance. In the meantime, this entire process should take under 1 hour and requires no real custom coding.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
tazzydemon
Actually this sidesteps the answer in the usual way. Using the wordpress example for author.php, it actually works but the formatting is wrong. In the end I merely want bios not post lists. Just the normal wordpress author.php - nothing more fancy In an attempt to get this I added a page.author.php and a section.author.php. I then used a template redirect I found to test for /author/ and include page.author.php. I used this code (might be wrong now but you get the idea): add_action( 'template_redirect', 'platformbase_template_redirect' ); function platformbase_template_redirect(){ $base_authorid = get_query_var( 'author' ); if (!empty($base_authorid)) { //This line could also be wp_redirect include( STYLESHEETPATH .'/page.author.php' ); //wp_redirect('/wp-content/themes/platformbase/page.author.php'); exit; } Of course that doe not work either. Wordpress and Platform expect author.php ..then index.php and render as expected. You can't call page.author.php directly. I just simply need Platform to react to /author/ or provide an author.php as usual. I don't want to use a sledgehammer to crack a nut!

Share this post


Link to post
Share on other sites
tazzydemon
For instance this author.php sort of works - I just don't know how to format it properly using sections and templates in a Platform context. The code I nicked from the content section and added the primitive bio part (and left main in) Not that this author is more or less junk - its just shows the idea. Just click the author name on a post. I am convinced this is what many are asking for.. simple as that -------------author.php to be put in base--------------

About: nickname; ?>

Website
user_url; ?>
Profile
user_description; ?>

Posts by nickname; ?>:

  • , in
layout_mode == 'two-sidebar-center'):?>
----------------------end------------------

Share this post


Link to post
Share on other sites
Danny
Hi tazzydemon (cool name by the way) Would it be possible for you to link to your site so I can see what you have done so far regarding this author page please?

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
tazzydemon
There is a test site on http://tazzydemon.com/author/admin/ I have removed all the client branding that I can find and its very bare but you will get the point. This uses author.php with the code I showed - code that splats the posts before the very crude bio. I am not interested in the posts I have been trying to work out out how platform figures out which template to use. I see the use of such as is_category() and is_archive() but only one instance of is_author() which is inside an is_archive() test. How do I force the use of a page type corresponding to is_author() = true ? In the meanwhile I have no idea at all which page type this is using. Wordpress page types to Platform page types is not clear at all. Julian

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×