$stars_value = get_post_meta(get_the_ID(), 'stars', true);
// Maximum stars to display
$max_stars = 5;
for ($i = 1; $i <= $max_stars; $i++) {
// Check if the current star
$star_class = ($i <= $stars_value) ? 'filled' : 'empty';
echo '<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="' . ($star_class === 'filled' ? '#FFC62B' : '#C4C4C4') . '">
<path d="M21.8346 9.07699L15.6611 8.63707C15.3727 8.61752 15.1332 8.44644 15.0257 8.1776L12.699 2.444C12.4497 1.833 11.5748 1.833 11.3255 2.444L8.9988 8.1776C8.89126 8.44644 8.65175 8.61752 8.36336 8.63707L2.18983 9.07699C1.52507 9.12587 1.25623 9.95194 1.76458 10.3821L6.50104 14.3658C6.72099 14.5515 6.81387 14.8302 6.74543 15.1137L5.2546 21.121C5.0933 21.7711 5.80205 22.2794 6.36906 21.9275L11.6188 18.6526C11.8632 18.501 12.1564 18.501 12.4057 18.6526L17.6554 21.9275C18.2224 22.2794 18.9263 21.7662 18.765 21.121L17.2742 15.1137C17.2057 14.8302 17.2937 14.5515 17.5186 14.3658L22.255 10.3821C22.7682 9.95194 22.4994 9.12587 21.8346 9.07699Z"/>
</svg>';
}
which works correctly except for the fact that WP get_post_meta(get_the_ID(), ‘stars’, true); returns the current page ID, which is correct behavior, so I used render block to change the query loop block like this:
add_filter('render_block', function($block_content, $block) {
if (!empty($block['attrs']['className']) && 'stars-holder' === $block['attrs']['className']) {
$stars_value = get_post_meta(get_the_ID(), 'stars', true);
// Maximum stars to display
$max_stars = 5;
for ($i = 1; $i <= $max_stars; $i++) {
// Check if the current star
$star_class = ($i <= $stars_value) ? 'filled' : 'empty';
// Modify the block content here
$block_content .= '<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="' . ($star_class === 'filled' ? '#FFC62B' : '#C4C4C4') . '">
<path d="M21.8346 9.07699L15.6611 8.63707C15.3727 8.61752 15.1332 8.44644 15.0257 8.1776L12.699 2.444C12.4497 1.833 11.5748 1.833 11.3255 2.444L8.9988 8.1776C8.89126 8.44644 8.65175 8.61752 8.36336 8.63707L2.18983 9.07699C1.52507 9.12587 1.25623 9.95194 1.76458 10.3821L6.50104 14.3658C6.72099 14.5515 6.81387 14.8302 6.74543 15.1137L5.2546 21.121C5.0933 21.7711 5.80205 22.2794 6.36906 21.9275L11.6188 18.6526C11.8632 18.501 12.1564 18.501 12.4057 18.6526L17.6554 21.9275C18.2224 22.2794 18.9263 21.7662 18.765 21.121L17.2742 15.1137C17.2057 14.8302 17.2937 14.5515 17.5186 14.3658L22.255 10.3821C22.7682 9.95194 22.4994 9.12587 21.8346 9.07699Z"/>
</svg>';
}
}
return $block_content;
}, 10, 2);
But it’s not working for some reason; perhaps you can help me identify my mistakes? Thanks.
]]>$stars_value = get_post_meta(get_the_ID(), 'stars', true);
// Maximum stars to display
$max_stars = 5;
for ($i = 1; $i <= $max_stars; $i++) {
// Check if the current star
$star_class = ($i <= $stars_value) ? 'filled' : 'empty';
// Modify the block content here
echo '<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="' . ($star_class === 'filled' ? '#FFC62B' : '#C4C4C4') . '">
<path d="M21.8346 9.07699L15.6611 8.63707C15.3727 8.61752 15.1332 8.44644 15.0257 8.1776L12.699 2.444C12.4497 1.833 11.5748 1.833 11.3255 2.444L8.9988 8.1776C8.89126 8.44644 8.65175 8.61752 8.36336 8.63707L2.18983 9.07699C1.52507 9.12587 1.25623 9.95194 1.76458 10.3821L6.50104 14.3658C6.72099 14.5515 6.81387 14.8302 6.74543 15.1137L5.2546 21.121C5.0933 21.7711 5.80205 22.2794 6.36906 21.9275L11.6188 18.6526C11.8632 18.501 12.1564 18.501 12.4057 18.6526L17.6554 21.9275C18.2224 22.2794 18.9263 21.7662 18.765 21.121L17.2742 15.1137C17.2057 14.8302 17.2937 14.5515 17.5186 14.3658L22.255 10.3821C22.7682 9.95194 22.4994 9.12587 21.8346 9.07699Z"/>
</svg>';
}
which works correctly except for the fact that WP get_post_meta(get_the_ID(), ‘stars’, true); returns the current page ID, which is correct behavior, so I used render block to change the query loop block like this:
add_filter('render_block', function($block_content, $block) {
if (!empty($block['attrs']['className']) && 'stars-holder' === $block['attrs']['className']) {
$stars_value = get_post_meta(get_the_ID(), 'stars', true);
// Maximum stars to display
$max_stars = 5;
for ($i = 1; $i <= $max_stars; $i++) {
// Check if the current star
$star_class = ($i <= $stars_value) ? 'filled' : 'empty';
// Modify the block content here
$block_content .= '<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="' . ($star_class === 'filled' ? '#FFC62B' : '#C4C4C4') . '">
<path d="M21.8346 9.07699L15.6611 8.63707C15.3727 8.61752 15.1332 8.44644 15.0257 8.1776L12.699 2.444C12.4497 1.833 11.5748 1.833 11.3255 2.444L8.9988 8.1776C8.89126 8.44644 8.65175 8.61752 8.36336 8.63707L2.18983 9.07699C1.52507 9.12587 1.25623 9.95194 1.76458 10.3821L6.50104 14.3658C6.72099 14.5515 6.81387 14.8302 6.74543 15.1137L5.2546 21.121C5.0933 21.7711 5.80205 22.2794 6.36906 21.9275L11.6188 18.6526C11.8632 18.501 12.1564 18.501 12.4057 18.6526L17.6554 21.9275C18.2224 22.2794 18.9263 21.7662 18.765 21.121L17.2742 15.1137C17.2057 14.8302 17.2937 14.5515 17.5186 14.3658L22.255 10.3821C22.7682 9.95194 22.4994 9.12587 21.8346 9.07699Z"/>
</svg>';
}
}
return $block_content;
}, 10, 2);
But it’s not working for some reason; perhaps you can help me identify my mistakes? Thanks.
]]>Why is 21% VAT applied to items in cart with delivery address in United Kingdom (UK)?
https://ibb.co/89s0R3v
UK is added to list of countries with “Zero rate rates” (auto-suggested as GB from auto-complete dropdown):
https://ibb.co/yXKwPnh
CH and NO have 0% VAT fine. Could it be related to some recent update? I hadn’t tested zero rate for shipping addresses in UK before.
Many thanks,
Janis
I wanted to contact the Polylang team regarding your plugin’s ccTLD options to request one for uk.
Currently, there is only an option for .gb which is no longer used since .uk became the established ccTLD. You can check many references online to confirm this. Here’s one: https://www.holisticseo.digital/technical-seo/cctld/
Thanks in advance and looking forward to your reply!
]]>I’m using another plugin from a developer in a different country and a lot of the English they use is clunky, with poor grammar and US English spellings, which is not what I want my UK audience to see.
I would never have thought of ‘translating’ it, if it were not for that developer suggesting it, but your plugin is so brilliant it’s making the job really easy. (It helps that they’ve already provided the sets).
The other thing that I really want to commend you on is your excellent instructions. They’re written by someone who understands that the user doesn’t already know how to use the product (obvious, but so often missing in plugin instructions!) and are easy to follow.
Huge well done.
]]>I am using Generatepress theme with the GB, and I trying to make a simple portfolio pages.
It fits the idea of having a very light weight website.
Again, I comes up with so many beginner’s issues.
Recently, I have confussions about the container width.
I am editing my WordPress site using Chrome Browser.
First, I’ll start with the GenerateBlocks Grid.
In the Desktop Tab, I set the width to be 50%, so it would displayed the images in 2 columns, but it only works in the back end while I’am editing the page.
* Windows – Firefox/Chrome, it displays right.
* Android – Chrome, it displays the images 1 column only.
* Android – Chrome desktop site, same thing.
All the grids, positioned left, unlike my products page which the GB Grid works nice.
My questions are :
1. How to make the grid displays 2 columns? Am I missing some thing?
2. How to make the grid displayed on PC to be in the center of the page?
A week ago, I don’t find this issue while I am working on my products page.
Really appreciate the help.
thanks.
]]>https://web.patbell.co.uk/web/
https://www.ads-software.com/plugins/custom-content-by-country/
]]>The last thing I remeber I did was entering coach name Edgar ‘Egy’ Cruz the u has an acute character, after that I found an error in top of the screen.
https://www.ads-software.com/plugins/leaguemanager/
]]>