The %date-modified('F jS, Y')% in post footer not working
Hi Flynn,
I put %date-modified('F jS, Y')% in the theme options, and it's being output as is, literally: %date-modified('F jS, Y')% I can't figure out what might be causing this. Thanks in advance for your help. |
This is a bug, thanks for finding. To fix it replace in functions/bfa_postinfo.php, line 135
PHP Code:
PHP Code:
|
Thanks, and I'm glad I could help.
|
Hmm. This is rather scary. I have gone to Appearance>Editor and clicked on my bfa_postinfo.php file and did a search for what we have to replace, and my file doesn't have such a line. Gulp! :(
Can I just add the new line? Does it matter where in the excerpt below? $postinfo = $postinfo_string; $postinfo = preg_replace("/(.*)%tags\((.*?)\)%(.*)/i", "\${1}" .$tags. "\${3}", $postinfo); $postinfo = preg_replace("/(.*)%tags-linked\((.*?)\)%(.*)/i", "\${1}" .$tags_linked. "\${3}", $postinfo); $postinfo = str_replace("%author%", $author, $postinfo); $postinfo = str_replace("%author-linked%", $author_linked, $postinfo); $postinfo = preg_replace("/(.*)%date\((.*?)\)%(.*)/i", "\${1}" .$date. "\${3}", $postinfo); $postinfo = str_replace("%category%", $category_notlinked, $postinfo); $postinfo = str_replace("%category-linked%", $category_linked, $postinfo); $postinfo = preg_replace("/(.*)%categories\((.*?)\)%(.*)/i", "\${1}" .$categories. "\${3}", $postinfo); $postinfo = preg_replace("/(.*)%categories-linked\((.*?)\)%(.*)/i", "\${1}" .$categories_linked. "\${3}", $postinfo); $postinfo = preg_replace("/(.*)%comments\((.*?)\)%(.*)/i", "\${1}" .$comment_link. "\${3}", $postinfo); $postinfo = preg_replace("/(.*)%comments-rss\((.*?)\)%(.*)/i", "\${1}" .$comments_rss_link. "\${3}", $postinfo); $postinfo = str_replace("%trackback%", $trackback_url, $postinfo); $postinfo = preg_replace("/(.*)%trackback-linked\((.*?)\)%(.*)/i", "\${1}" .$trackback_link. "\${3}", $postinfo); $postinfo = preg_replace("/(.*)%edit\((.*?)\)%(.*)/i", "\${1}" .$edit. "\${3}", $postinfo); $postinfo = preg_replace("/(.*)%print\((.*?)\)%(.*)/i", "\${1}" .$print_link. "\${3}", $postinfo); $postinfo = str_replace("%wp-print%", $wp_print, $postinfo); $postinfo = str_replace("%wp-email%", $wp_email, $postinfo); $postinfo = str_replace("%wp-postviews%", $wp_postviews, $postinfo); $postinfo = str_replace("%wp-postratings%", $wp_postratings, $postinfo); $postinfo = str_replace("%sociable%", $sociable, $postinfo); if (strpos($postinfo_string,'<image(')!==false) { // images $postinfo = preg_replace_callback("|<image\((.*?)\)>|","image_ files",$postinfo); } return $postinfo; } ?> I have been rather daring and went ahead and added your line Flynn, so that now I have: $postinfo = $postinfo_string; $postinfo = preg_replace("/(.*)%tags\((.*?)\)%(.*)/i", "\${1}" .$tags. "\${3}", $postinfo); $postinfo = preg_replace("/(.*)%tags-linked\((.*?)\)%(.*)/i", "\${1}" .$tags_linked. "\${3}", $postinfo); $postinfo = str_replace("%author%", $author, $postinfo); $postinfo = str_replace("%author-linked%", $author_linked, $postinfo); $postinfo = preg_replace("/(.*)%date\((.*?)\)%(.*)/i", "\${1}" .$date. "\${3}", $postinfo); $postinfo = preg_replace("/(.*)%date-modified\((.*?)\)%(.*)/i", "\${1}" .$date_modified. "\${3}", $postinfo); $postinfo = str_replace("%category%", $category_notlinked, $postinfo); $postinfo = str_replace("%category-linked%", $category_linked, $postinfo); $postinfo = preg_replace("/(.*)%categories\((.*?)\)%(.*)/i", "\${1}" .$categories. "\${3}", $postinfo); $postinfo = preg_replace("/(.*)%categories-linked\((.*?)\)%(.*)/i", "\${1}" .$categories_linked. "\${3}", $postinfo); $postinfo = preg_replace("/(.*)%comments\((.*?)\)%(.*)/i", "\${1}" .$comment_link. "\${3}", $postinfo); $postinfo = preg_replace("/(.*)%comments-rss\((.*?)\)%(.*)/i", "\${1}" .$comments_rss_link. "\${3}", $postinfo); $postinfo = str_replace("%trackback%", $trackback_url, $postinfo); $postinfo = preg_replace("/(.*)%trackback-linked\((.*?)\)%(.*)/i", "\${1}" .$trackback_link. "\${3}", $postinfo); $postinfo = preg_replace("/(.*)%edit\((.*?)\)%(.*)/i", "\${1}" .$edit. "\${3}", $postinfo); $postinfo = preg_replace("/(.*)%print\((.*?)\)%(.*)/i", "\${1}" .$print_link. "\${3}", $postinfo); $postinfo = str_replace("%wp-print%", $wp_print, $postinfo); $postinfo = str_replace("%wp-email%", $wp_email, $postinfo); $postinfo = str_replace("%wp-postviews%", $wp_postviews, $postinfo); $postinfo = str_replace("%wp-postratings%", $wp_postratings, $postinfo); $postinfo = str_replace("%sociable%", $sociable, $postinfo); if (strpos($postinfo_string,'<image(')!==false) { // images $postinfo = preg_replace_callback("|<image\((.*?)\)>|","image_ files",$postinfo); } return $postinfo; } ?> But I still get the literal stuff. |
There are 2 bfa_postinfo.php. The one you need to edit isn't accessible from Appearance --> Editor. You can edit it through FTP by going to /wp-content/themes/atahualpa3/functions/bfa_postinfo.php
The one in Editor is located in /wp-content/themes/atahualpa3/bfa_postinfo.php |
Hey, I am having the same problem, and I edited the correct file as specified, but no effect.
Thanks in advance. |
Thanks to all! I found the file and made the change and the %date-modified% variable now works OK.
Thanks for all your help. |
You're welcome, Perdox.
RobertSGold, After (or before) editing the file /wp-content/themes/atahualpa3/functions/bfa_postinfo.php, did you put %date-modified('F jS, Y')% in the theme options? |
Yes, I got rid of the line I inserted via the Admin>Editor and used the ftp client to copy the file to my machine, edited it (i.e. put that new line of code in), copied it back to server and all was well in my little brain! I was a happy chappy to say the least. Is this the correct procedure? I shouldn't try to edit the file while it is still on the server, should I?
I was working my way through all the options as described in the theme settings in the 'Post/Page Info Items' just out of curiosity. That's how I discovered the problem with the date-modified and the fact that if you put the %author-email% in the configuration fields, it throws the sidebars out. Flynn has already fixed this. Everything works fine now with the code in the correct file. :):):) |
Glottis:
Thanks - what wasn't clear to me was that the date format is specified both in the general WP options and in the Post Info Items options. Working as desired now. Many thanks. |
Quote:
Quote:
|
The other bfa_postinfo.php, the one in the root directory is there by accident. Sorry about that
|
All times are GMT -6. The time now is 03:09 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.