Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Montezuma Theme »

get_avatar function doesn't work

Old Dec 7, 2012, 11:23 PM
4 posts · Dec 2012
The following code does not work in the Montezuma theme. It does work on the default Twenty Eleven theme.

This is important, because I want to be able to show the avatar of the author of each post (multi-author blog) right on the home page. kind of like at penny-arcade.com

PHP Code:
 echo get_avatar(get_the_author_meta('user_email')); 

Last edited by ghostsquad; Dec 8, 2012 at 12:00 AM.
Old Dec 8, 2012, 02:09 AM
4 posts · Dec 2012
I figured out what's causing this code to not run.. kinda..


essentially, there's a white list of php functions that can run. I've tried adding "get_avatar" to the list, but it didn't work. I'm so very confused about why I can't run my own php.. why was this implemented?
Old Dec 8, 2012, 02:56 AM
4 posts · Dec 2012
Ok, I read the Mentezuma options a bit more regarding sub templates and what not. Sounds like if you want to do whatever you want to do (any php code), you gotta use a sub template.. ok that's fine. But how do you include it. The "readme" talks about "bfa_get_template_part", but that function isn't in the whitelist. So how do you actually include custom sub templates? I guess what I'm really trying to do is modify postformat.php which is it's own subtemplate.. I don't really want a new "postformat" template at this time, because I want to change what the default looks like... this is all very frustrating, and really makes me want to just start over with a different theme and code this myself. Can anyone help?
Old Dec 8, 2012, 08:04 AM
juggledad's Avatar
23,761 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
The reason you can't just run any php is that WordPress banned the use of the eval() function in themes. So in order to add psuedo php in, Montezuma has to have a link to the function in the code so it can parse the psuedo code, recognize it and them call the appropriate function.

I sent a suggestion about having a user white list added to the theme about a month ago
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
get_avatar and the post footer KarlHvM Center area post/pages 1 Oct 12, 2012 02:05 PM
Adsense doesn't work in homepage, but work in other pages. JavaBen Header configuration & styling 1 May 24, 2010 06:48 AM
'Read more' function won't work GlobalNeat Excerpts, Read more, Pagination 12 May 5, 2010 07:32 AM
SwitchLang Function Lyryanne Atahualpa 3 Wordpress theme 0 Feb 2, 2010 05:46 AM

All times are GMT -6. The time now is 06:40 AM.

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