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)
-   -   get_avatar function doesn't work (http://forum.bytesforall.com/showthread.php?t=19072)

ghostsquad Dec 7, 2012 11:23 PM

get_avatar function doesn't work
 
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')); 


ghostsquad Dec 8, 2012 02:09 AM

I figured out what's causing this code to not run.. kinda..

bfa_get_whitelist()

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?

ghostsquad Dec 8, 2012 02:56 AM

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?

juggledad Dec 8, 2012 08:04 AM

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


All times are GMT -6. The time now is 04:05 AM.

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