linzD
Forum Replies Created
-
This sorted it! Thanks.
Remove Query Strings from Static ResourcesThank you. That’s a good shout. I am bit out of practice as a coder, but re-wrote in JS rather than PHP.
Hopefully that’ll solve the issue.Forum: Plugins
In reply to: [WPS Hide Login] Allow access to /wp-admin/ – sometimes!Hi Nicolas,
Thanks for the speedy response.
Would be great to see it in a future version.
Cheers,
Linz
Thanks for the note.
I’ve asked my host (Siteground) and they say that the the Googlebots can search the page OK. They even showed me on AW Stats that the wider site is being crawled.
I’ve tried to use the robots testing tool, but it seems to be broken – when I got there it doesn’t show my ‘property’. When I click ‘add property’ it shows it but doesn’t give me anyway to use it within the robots testing tool.
I’m at a bit of a loss – any other ideas please?
That’s brilliant. Thanks John.
I did have a good look for it on a couple of occasions, but if no one else has raised it as hard to find then it probably is just me being dense.
Thanks again for an excellent plugin.
Ta
Forum: Hacks
In reply to: Using str_replace filter in WooCommerceHello bcworkz,
Thanks for your help so far.
To address your suggestion around ‘ngettext’ logically this seems spot on because the code I am trying to target is within the _n( function.
I believe this function is essentially to decide (based on $count) whether the text returned is should be $singular or $plural.
printf( _n( '%s review for %s', '%s reviews for %s', $count, 'woocommerce' )
I have used this filter successfully.
`add_filter(‘gettext’, ‘lnz_translate_text’);
add_filter(‘ngettext’, ‘lnz_translate_text’);function lnz_translate_text($translated) {
$translated = str_ireplace(‘%s reviews for %s’, ‘What do others say?’, $translated);
$translated = str_ireplace(‘%s review for %s’, ‘What do others say?’, $translated);
$translated = str_ireplace(‘customer review’, ‘volunteer review’, $translated);
$translated = str_ireplace(‘customer review’, ‘volunteer reviews’, $translated);
return $translated;
}’I think the big learning from this is that ‘gettext’ doesn’t work for text within ‘n_(‘ but I’m still not 100% on why or the technical difference between gettext and ngettext.
Cheers,
Linz
Forum: Hacks
In reply to: Using str_replace filter in WooCommerceHi bcworkz,
Thanks for that and no worries about being blunt.
I do know about template overrides via using a Child Theme.
However, we run a fairly highly customised WordPress/WooCommerce site and I’d like to find ways to do things without changing templates (for the sake of a few words) because it requires a fair amount of re-work for every new iteration of WooCommerce or the plugin.
I’m enjoying learning how to use snippets of code to do the same and I’ve got add_action and remove_action down to a tee but struggling a little with the filters.
For the most text, i’ve been using gettext but it doesn’t seem to work when there are variables %s reviews for %s”,”%s comments about %s (like %) involved.
Are you able to suggest a solution which uses a snippet of code to target specific text? I think it would be super useful because I’d like to change other text throughout the website (some included in plugins) too.
Thanks for your help.