HowToSolutionsNet
Forum Replies Created
-
Forum: Plugins
In reply to: [WebberZone Top 10 — Popular Posts] Ability to show number of commentsThanks for the quick reply.
For some reason, the
get_comments_number( $result->ID )was giving me wrong number of comments, so I used this instead:$comments_count = $result->comment_count;It works perfectly now.
- This reply was modified 6 years, 11 months ago by HowToSolutionsNet.
Forum: Plugins
In reply to: [Contact Form 7] URL field validation is too strictHi,
I have noticed the original issue was fixed, but I still needed my own custom domain validation for the URL field.
So I created a blog post that shows, how to add custom URL validation by using a Contact Form 7 custom filter.
I hope you find it useful.
Forum: Plugins
In reply to: [Hana Flv Player] splash image e video controlsI have the same problem.
If I use splashimage, the video controls are not visible so to the visitors it looks like a normal image and not a video player. You need to click on the image for video controls to show up.
I am using 5. medialelement.js. The video files are in .flv format.
Forum: Fixing WordPress
In reply to: Change alternative text for featured images when using qtranslateHave you looked into the source code and checked what value alt text have?
Or are you assuming it doesn’t work because when you hover over the image, the text does not get translated.
I tested that theme and also thought that nothing got changed but then remembered that hover effect is created with a title tag so we need to make those changes for that tag too.
Find this code around line 420
/* If $link_to_post is set to true, link the image to its post. */ if ( $link_to_post ) $html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a>';And replace it with this:
/* If $link_to_post is set to true, link the image to its post. */ if ( $link_to_post ) { $title=__(get_post_field( 'post_title', $post_id )); $html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( $title ) . '">' . $html . '</a>'; }Forum: Fixing WordPress
In reply to: Change alternative text for featured images when using qtranslateYou were right all along. Code that creates the problematic alternative text is
<?php if ( current_theme_supports( 'get-the-image' ) ) get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'featured-thumbnail' ) );That get-the-image function was really hidden. I located it at
Themes\oxygen\library\extensions\get-the-image.php
Inside it at around line 400 or so you will find the following code:
/* If there is alt text, set it. Otherwise, default to the post title. */ $image_alt = ( ( !empty( $image['alt'] ) ) ? $image['alt'] : get_post_field( 'post_title', $post_id ) );After that line add this:
$image_alt=__($image_alt);Then there are two more places, where alternative text is set like this:
$alt=trim....You can do the same with them but I suspect the $image_alt is the one you need to fix.
I am curious if this will fix the issue, so keep me informed:)
Forum: Fixing WordPress
In reply to: Change alternative text for featured images when using qtranslateMy blog post is about how to make alt-text that the_post_thumbnail() produces support different languages.
Your problem differs a little since you wrote “The featured images shown in the front page slider “.
So first you need to figure out which template front page uses and then locate code that outputs alternative text in that slider. Once you find it, try putting that code as parameter for _e() function. This should filter the text, so that only language for the current language will be used.
To learn more about _e() check this WordPress Codex Page.
If you still have trouble solving your problem, you can try to get into contact with me using social icons on my blog and I will try to help out.
Forum: Fixing WordPress
In reply to: Change alternative text for featured images when using qtranslateI also had the same problem recently and just wrote an article on my blog on how to solve that.
I hope you will find it useful.
Just discovered that by adding id or class attribute to the span tag seems to solve the problem.