WP SITES
Forum Replies Created
-
Thank You.
Forum: Plugins
In reply to: [WooCommerce] modifying the product ratings blockI never provided any working code. The CSS rule i posted is an example which needs to be modified to include the class you want to target. You’ll also need to use the same rule to target the same class for elements on desktops as well as mobile devices and change the value for grid-template-columns: from 1fr on mobiles to another value on desktops.
I’ve used this method dozens of times.
Forum: Plugins
In reply to: [WooCommerce] modifying the product ratings blockInstall a child theme and use CSS grid to control the columns at different screen widths.
@media (max-width: 800px) {
.your-selector {
display: grid;
grid-template-columns: 1fr;
}
}Forum: Plugins
In reply to: [WooCommerce] modifying the product ratings blockWhich block are you using? You can use CSS to remove the star rating.
I tried this like button plugin https://ww.wp.xz.cn/plugins/favorites/
Thank You
No. I tried that and they’re not clickable.
They either need adding use a filter or jQuery.
I removed the entire folder of notices. That worked. Thanks.
Forum: Plugins
In reply to: [WooCommerce] Enable Reviews on Single Product Page Not SavingThank You. It’s something in my child theme. Once i switched to the parent theme, it enabled me to save the value then i switched back.
Forum: Plugins
In reply to: [WooCommerce] Enable Reviews on Single Product Page Not SavingI cleared server caching. The problem is the enable reviews checkbox does not save on the single product page. https://youtu.be/oLwwYN35V7M
Forum: Plugins
In reply to: [Payment Plugins for Stripe WooCommerce] Main ClassGreat!
Forum: Plugins
In reply to: [WooCommerce] International issues and blank ordersIt could be a theme issue, a plugin issue or a payment gateway issue.
Which payment gateway was used for the orders which where problematic? You could test in sandbox to try and isolate the issue.
You could also test by deactivating plugins and changing themes. Looks like you are using way t many plugins and a theme which is out of date and bloated. Consider Twenty Twenty Four and much less plugins to avoid problems.
Single event post type requiring addition of Apple and Google pay buttons.
single-event_listing
- This reply was modified 1 year, 10 months ago by WP SITES.
Forum: Themes and Templates
In reply to: [Twenty Twenty-Four] how to filter default nav menuThis will filter the navigation block in Twenty Twenty Four.
add_filter( 'render_block_core/navigation', 'wpsites_nav_menu_admins', 10, 2 );
function wpsites_nav_menu_admins( $block_content, $block ) {
if ( isset( $block['blockName'] ) && 'core/navigation' === $block['blockName'] ) {
if ( is_user_logged_in() && current_user_can( 'administrator' ) ) {
$custom_message = '<p class="admin-message">Welcome, Admin!</p>';
$block_content = $custom_message . $block_content;
}
}
return $block_content;
}To target a specific menu item., use code like this :
add_filter( 'render_block_core/navigation', 'wpsites_modify_specific_menu_item_for_admins', 10, 2 );
function wpsites_modify_specific_menu_item_for_admins( $block_content, $block ) {
if ( isset( $block['blockName'] ) && 'core/navigation' === $block['blockName'] ) {
if ( is_user_logged_in() && current_user_can( 'administrator' ) ) {
$dom = new DOMDocument();
@$dom->loadHTML('<?xml encoding="utf-8" ?>' . $block_content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
$xpath = new DOMXPath($dom);
$menu_items = $xpath->query('//a');
foreach ($menu_items as $menu_item) {
if ($menu_item->textContent === 'Product') {
$menu_item->setAttribute('class', 'admin-custom-class');
// $menu_item->setAttribute('href', 'https://example.com/admin-special');
}
}
$block_content = $dom->saveHTML();
}
}
return $block_content;
}Forum: Themes and Templates
In reply to: [Twenty Twenty-Four] WordPress Gallery Shortcode Not WorkingThanks Gordon.