Artur_G
Forum Replies Created
-
Forum: Plugins
In reply to: [Polylang] Flags image and height attributesI made it! Let me deliver beginner friendly solution.
You need to add this code as a plugin, there is planty tutorials out there about this topic. You have to change only marked lines, the rest remains.
add_filter( ‘pll_custom_flag’, ‘pll_custom_flag’, 10, 2 );
function pll_custom_flag( $flag, $code ) {
$flag[‘url’] = “https://domain.com/wp-content/polylang/{$code}.svg”; <— path to your local SVG files; file names: gb.svg (NOT en_GB.svg), pl.svg (NOT pl_PL.svg) and so on, I have no idea where to find list of those codes.
$flag[‘width’] = 18; <— your desired width
$flag[‘height’] = 12; <— your desired height
return $flag;
}Forum: Plugins
In reply to: [Polylang] Flags image and height attributesI have managed to create:
<?php
/**Plugin Name: test-plugin
add_filter( ‘pll_custom_flag’, ‘pll_custom_flag’, 10, 2 );
function pll_custom_flag( $flag, $pl ) {
$flag[‘url’] = “https://domain.eu/wp-content/polylang/pl_PL.svg”;
$flag[‘width’] = 18;
$flag[‘height’] = 12;
return $flag;
}Which gives me properly sized flag, but it’s one and the same flag for both of the languages. Would be great to have an example how to use it for two flags.
Minor update: it seems to be working with Fastest Cache if you will exclude ‘wpgdprc-consent’ cookie from settings.
Hi the same problem here: it doesn’t seem to work with W3 Total Cache (or Cache Enabler) enabled. Is there any cache solution compatible with this plugin?
Forum: Plugins
In reply to: [Report Content] Gallery not workingAlready resolved – it’s a CSS thing – div with your plugin was overlaying div with the gallery. After placing the one under the other, everything works.