Missing image
-
Hi, maybe a dumb question.
On the english page ‘My posts’ the image of the text balloon (wp-includes/images/wlw/wp-comments.png) is OK.
On the French and spanish versions of this page (e.g. /?lang=fr/wp-includes/images/wlw/wp-comments.png) it is missing. Any ideas how to solve this?
-
I expect that you are using WPML, this is a known bug/challenge with WPML.
If the file “comments.png” exists in your images subfolder of your active theme, Frontier post will use this.
A workaround could be to copy the comment icon (wp-includes/images/wlw/wp-comments.png)
to:
../wp-content/themes/[Your Active Theme]/images/comments.png
It might work …..
Hi Finnj,
Yes, I’m using WPML. I copied the ‘wp-comments.png’ as ‘wp-comments.png’ as well as ‘comments.png’ to both the images folder and the active theme images subfolder, but it doesn’t work. Good that you mention it as a known issue with WPML, I can ask them to fix it.
Thanks,
LeonHi,
If you can ask them how to avoid that
/?lang=fr/is addedto the url.I am using this piece of code to display the comment icon, and I believe that WordPress finds the icon as a file, but the url to the file is wrong, as WPML most likely appends the language to the bloginfo
Code:
function frontier_get_comment_icon() { $comment_icon = TEMPLATEPATH."/images/comments.png"; if (file_exists($comment_icon)) { $comment_icon_html = "<img src='".get_bloginfo('template_directory')."/images/comments.png'></img>"; } else { $comment_icon = ABSPATH."/wp-includes/images/wlw/wp-comments.png"; // if no icon in theme, check wp-includes, and if it isnt the use a space if (file_exists($comment_icon)) { $comment_icon_html = "<img src='".get_bloginfo('url')."/wp-includes/images/wlw/wp-comments.png'></img>"; } else { $comment_icon_html = " "; } } return $comment_icon_html; }My name is Helena and I am from WPML team. I am contacting you about Leon’s problem.
We would like to work together in solving this problem and making your theme/plugin compatible with WPML.Could you please drop me a line back? [email protected]
Hi Finnj and Helena,
any news on this subject?
Best regards,
LeonNo, not yet.
WPML could not help with the issue unless I did a full registration in their partner program – I will do that once I am ready with the new version (a couple of weeks), and then I dont know how long time it will take.
As for the specific issue, I might have an idea to solve it, buta I need your help as I dont have WPML.
Do you have a test system, and are you capable of editing php files ?
If you have a test system, can you try and insert the below code temporarily in the frontier_list form in the forms directory, in the line after
<?phpand then let me know what the output is.
//test comment icon echo "<hr>"; $theme_icon = get_template_directory_uri()."/images/comments.png"; $frontier_icon = get_stylesheet_directory_uri()."/plugins/frontier-post/comments.png"; $wp_icon = includes_url()."/images/wlw/wp-comments.png"; echo "Theme Icon: get_template_directory_uri() -->".$theme_icon."/plugins/frontier-post/comments.png"." | icon: <img src='".$theme_icon."'></img>"."<br>"; echo "Child theme Icon: get_stylesheet_directory_uri() -->".$frontier_icon." | icon: <img src='".$frontier_icon."'></img>"."<br>"; echo "WP Icon: includes_url() -->".$wp_icon." | icon: <img src='".$wp_icon."'></img>"."<br>"; echo "<hr>";Hi Finnj,
that had not the result you wanted. If you mail me an e-mailadress I can send you a screenshot.
Email: finnj at wpfrontier dot com
Hi,
This should work, and will be in the new version.
Go to the php file frontier_post_util.php and find the function
and the comment out the existing function by adding/*before the function and*/after the function, and then paste the below in:function frontier_get_comment_icon() { // first Frontier Post template folder $comment_icon = get_stylesheet_directory()."/plugins/frontier-post/comments.png"; if (file_exists($comment_icon)) { $comment_icon_html = "<img src='".get_stylesheet_directory_uri()."/plugins/frontier-post/comments.png'></img>"; } else { // Then the theme (not child theme folder) $comment_icon = get_template_directory()."/images/comments.png"; // if no icon in theme, check wp-includes, and if it isnt the use a space if (file_exists($comment_icon)) { $comment_icon_html = "<img src='".get_template_directory_uri()."/images/comments.png'></img>"; } else { // Fallback, the standard wp comment icon $comment_icon_html = "<img src='".includes_url()."/images/wlw/wp-comments.png'></img>"; } } return $comment_icon_html; }Hi Finnj,
thanks, it works!
Best regards,
LeonIt will be in the next version – thanks for your assistance
This is now included in the new version 3.3.2 – You will have to install it manually, I would like some users to test it, before i make it the stable release
Documentation: http://wpfrontier.com
The topic ‘Missing image’ is closed to new replies.