Brad Dalton
Forum Replies Created
-
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://www.ads-software.com/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 4 months, 1 week ago by Brad Dalton.
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.
Thank You. The only problem is my host is running an old version of PHP and the plugin isn’t compatible.
Forum: Themes and Templates
In reply to: [Twenty Twenty-Four] WordPress Gallery Shortcode Not WorkingWorked out a temporary solution using code however still interested to know if the gallery shortcodes can be converted from classic to blocks without bulk converting posts to blocks.