Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   [SOLVED] Author Name on Single.php (http://forum.bytesforall.com/showthread.php?t=18594)

ganterd Oct 6, 2012 02:25 PM

[SOLVED] Author Name on Single.php
 
I'm having an issue with placing the author name in the right place on a single post page (single.php). I would like to have the author name between the post title and the tags field, but that doesn't work.

I'm trying to place the name has a h4 field like so: <h4><?php the_author(); ?></h4>

It doesn't work before the_content() is called, but starts working immediately after the_content() is called.

Am I missing something?

juggledad Oct 6, 2012 04:50 PM

you might want to put it in the sub Template 'postformat'

ganterd Oct 10, 2012 06:49 AM

Does this not change the format for the excerpts on the list of posts? I would like to add the author to the actual post page.

juggledad Oct 10, 2012 08:43 AM

It seems that there is a problem with retreiving the author meta data. I have a message into the developer and am waiting a response.

ganterd Oct 14, 2012 08:05 AM

Any update yet?

juggledad Oct 14, 2012 11:36 AM

He is working on a new release but that is all I know at this point.

baignoire Oct 27, 2012 09:21 AM

hi there,

not able either to sucessfully use "the_author_posts_link()" in single.php before "the_content()" is called in the template...

guess the same issue as mentionned by gantred... any news ???

this is quite embarrasing...

cheers
raf

juggledad Oct 27, 2012 10:07 AM

I've reported it. If you put it AFTER the_content() it will work.

baignoire Oct 28, 2012 02:28 AM

Quote:

Originally Posted by juggledad (Post 91969)
I've reported it. If you put it AFTER the_content() it will work.

yep, i saw this from previous posts. it remains a problem if you want something like :

______________________________
The post title
published by author on date

the content of the post
_____________________________

which is quite a common and logical display.

thanks for having reported anyway... will be waiting for upgrade ;)

Do you think it should work better if a physical template is used ?? (i'll give a try and let you know...)

cheers
raf

NickMackz Nov 20, 2012 08:32 AM

Any progress on this? I have the same issue.

juggledad Nov 20, 2012 09:00 AM

I haven't heard anything from the developer.

RobertO Nov 23, 2012 08:00 PM

I made a separate main template for each author. So under Appearance>Montezuma Option>Main Templates I selected "add main template," I called it "Author's Name-Template," and I opted that it be a copy of the "single" template. Then I altered it so that right after the closing </h1> tag of the post title section I put in a line saying "<h3>Authors Name</h3>".

This means that each author always has to select a separate template -- but it does make it look good to the reader.

This may be too hokey for you, but in case it works for someone I wanted to share.

goater Jan 28, 2013 12:22 PM

Yay! I've solved it!

Edit three lines in the file called parse_php.php, starting at line 28, as follows:
Code:

        $need_loop = array( 'the_content', 'the_author' );
        // not only the_content needs loop
        if( ! in_the_loop() && in_array( $function_name, $need_loop ) ) {

So... Add the name of every single wordpress function (which requires the loop) you want to use to the $need_loop array.
Moreover, add !in_the_loop() constraint.

And that's all. Enjoy!

ganterd Mar 5, 2013 07:24 AM

Excellent, thanks very much!

juggledad Mar 13, 2013 03:53 PM

Fixed with PATCH 113-06: the_author and other 'Limited PHP code' don't all work


All times are GMT -6. The time now is 11:37 AM.

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