jbd7
Forum Replies Created
-
You’re right, the regex should be adapted to match your img tag patterns. I see you have a
style="width: 480px; height: 640px;
on yours, so you would have to take it into consideration. I’m guessing any width and height can be ditched because you want your site and images to be responsive.I used http://www.phpliveregex.com/ to test it with some sample code from my site.
Hi MorpheusUK. I wanted the same thing, here is what I did. It also removes the fixed width that the plugin enforces.
I first added a filter to the caption shortcode to remove the width, as per https://wordpress.stackexchange.com/questions/129666/removing-height-and-width-from-images-with-a-caption
Then I added a filter in my child theme functions.php to remove width and height from the img tag and to add different Flickr sizes in srcset:
function responsify_flickr($content) { $content = preg_replace('/<img(.*src=\"(.*staticflickr.com.*).jpg\")(.*)width=\"(\d+)\"(.*)height=\"(\d+)\"(.*)\/>/i', '<img$1 srcset="$2_n.jpg 320w, $2.jpg 500w, $2_b.jpg 1024w"$3width="100%"$5$7/>', $content , -1); return $content; } add_filter( 'the_content', 'responsify_flickr' );The fallback picture for browsers not supporting srcset is the one you had initially selected, which remains in the src attribute. You can edit the regex to add more sizes in the srcset so that it fits your needs and what’s available among your flickr photos.
jb
Forum: Plugins
In reply to: [Responsify WP] RWP to srcset images from FlickrIn case someone has the same setup as me, I managed to do what I wanted and here is a solution. It was easier than I thought.
I first added a filter to the caption shortcode to remove the width, as per https://wordpress.stackexchange.com/questions/129666/removing-height-and-width-from-images-with-a-caption
Then I added a filter in my child theme functions.php to remove width and height from the img tag and to add different Flickr sizes in srcset:
function responsify_flickr($content) { $content = preg_replace('/<img(.*src=\"(.*staticflickr.com.*).jpg\")(.*)width=\"(\d+)\"(.*)height=\"(\d+)\"(.*)\/>/i', '<img$1 srcset="$2_n.jpg 320w, $2.jpg 500w, $2_b.jpg 1024w"$3width="100%"$5$7/>', $content , -1); return $content; } add_filter( 'the_content', 'responsify_flickr' );Forum: Plugins
In reply to: [Responsify WP] RWP to srcset images from FlickrRight, it’s all hosted on Flickr servers.
Thanks for replying quickly, I will try with a filter then. The developer of that WP-Flickr plugin is busy and I’m afraid there are not enough WP devs with their content on Flickr to write such a feature.
All the best with your 1.9,
JB
Forum: Plugins
In reply to: Limit Login Attempts plugin does not seem to workI had several attacks from that same IP.
I use https://wordpress.org/support/plugin/login-security-solution which works great.
Thanks. The ones you mention that I have too are up to date. I ran the test with plugins de-activates, with different htaccess and robots, unsuccessfully.
However, I noticed that if I remove the / at the end of the URLs that don’t pass the Mobile-Friendly test and re-run the test, it works. The test doesn’t accept a slash-less URL for a homepage, but if I add /?=1 at the end, it passes the test too.
I’m still investigating, if anyone has an idea of why this happens, feel free to tell me.
jb
Hi nickiova,
Can you tell which plugin exactly was faulty?
I have the same problem: my WPtouch mobile site displays correctly everywhere, including the Google PageSpeed Insights, but not on Google Mobile Friendly test, not on Webmaster Tools’ “Fetch as Google”.
Googlebot has access to everything it needs, so I wonder where is my problem.
Thanks,
jb
Thanks, I tried it, but nothing happened. So I went for better wordpress minify.
I solved my problem by:
1) editing wptouch.php in the WP Super Cache plugin folder and commenting out the line
//add_cacheaction('disable_mobile_check','wp_super_cache_maybe_disable_wptouch' );2) flushing the whole cache
The mobile version of pages are now delivered to mobile agents, regardless of the cache status of that page. The cache and super cache folders seem to be populated normally.
I didn’t read the whole code, so I’m still curious to know, from the developer or anyone else, for what and when that line is executed.
Thanks. Your suggestion is valid, the upgrade is planned for later.
Hi Ofer,
Thanks for your reply. No need anymore for a new thread as just yesterday, after many unsuccessful trials on possible conflicting plugins, Transposh finally came back to life after uninstalling it and reinstalling it (same version, 0.85). If it’d help to to see where the screenshot above appeared, it’s at freewheely.com.
And just to mention it, even before 1.0 this is such a great plugin bringing quickly high added value to a site, thank you.
jb
Hi Ofer,
I have something that could be similar, it’s happening since today. I recently changed the lightbox plugin from jQuery Colorbox to Lightview. Now, when editing translations, the Transposh popup does not appear anymore, but non-functional edit fields appear at the bottom of the page. (as in http://postimage.org/image/71fxhl1ct/).
I deactivated the recently upgraded plugins but can’t get Transposh to work again and display the edit window. Do you have an idea of the problem?
Thanks,
jb
Forum: Themes and Templates
In reply to: subMenus showing but disappeared when mouse overThanks Andrew,
I didn’t manage to apply this to the submenu but while playing withpaddingandtopwithin#navand#wrapperit works again.
With Chrome developper tools I had noticed there was an overlap between the menu and the wrapper. I still ignore how did this come up randomly.Forum: Themes and Templates
In reply to: subMenus showing but disappeared when mouse overNo, it’s the Arras theme 1.5.2.
It has a user.css into which I had added some lines to customize some borders and spaces some time ago.Forum: Themes and Templates
In reply to: subMenus showing but disappeared when mouse overIt has a dashboard menu “Theme options” and from inside there “default style” is set to “default.css”.
But I didn’t change the theme options recently.