Web Design Weekly #369

Headlines The Iceberg of React Hooks Without in-depth knowledge, performance problems can arise and code complexity can increase due to subtle bugs and leaky abstractions. In this post, Sandro Dolidze demonstrates common problems and ways to fix them. (medium.com) Browser Engine Diversity (css-tricks.com) Articles Investigate animation performance with DevTools In this post, Milica Mihajlija covers how browser rendering works and how to navigate DevTools to diagnose animation performance issues. (calibreapp.com) Variable fonts & the new Google Fonts API An article that covers what the new Google Fonts API means for…

Gutenberg First Block on Page Conditional?

I have been building some custom Gutenberg blocks using ACF PRO. I have a block that I have created where I want to show the title of the page in that block, BUT only if it is the first block on the page. If that block also appears lower on the page I don’t want it to show the title of the page. I’ve tried this: $post = get_post(); if ( has_blocks( $post->post_content ) ) { $blocks = parse_blocks( $post->post_content ); if ( $blocks[0][‘blockName’] === ‘acf/custom-block’ ) { } }…

AJAX to add to cart multiple products woocommerce

I found some AJAX on here to add a product to cart through WC through a button click, and I am trying to modify it to be able to add multiple products with the single click. I am not super familiar with AJAX and not a PHP expert, though I do know a decent amount. I couldn’t really figure out a way to do it in one AJAX call, so my current attempt is to run multiple AJAX calls to add a single product. The HTML (button): <a data-ids= »33507,33504, » class= »addToCartBtn »>Add…

Plugin error: td-composer E_COMPILE_ERROR

I got an email to my admin mailbox which states: An error of type E_COMPILE_ERROR was caused in line 17 of the file /home/vol13_6/thefrancisugorji.cf/www/htdocs/wp-content/plugins/td-composer/legacy/Newspaper/functions.php. Error message: require_once(): Failed opening required ‘includes/td_config.php’ (include_path=’.:/usr/share/pear/’) Please how do i fix this issue. A screenshot of the mail would be added below. Source: https://wordpress.stackexchange.com/feeds

Wed Design Weekly #368

Headlines The Ugly Truth about Design Systems Mark Boulton shares his concerns he has with the current thinking of what constitutes a good design system in our industry. (markboulton.co.uk) Caniuse and MDN compatibility data collaboration (mozilla.org) Sketch version control & design workflow management. Abstract: Design workflow management for product design teams using Sketch. Sign your team up for a free, 14-day trial today. Get a Free Trial. (abstract.com) Articles The problem with tooltips and what to do instead Although tooltips allow you to squeeze additional information on screen, they have…

Contact form 7 shortcode appear outside form tag

I have managed to do a test shortcode in my function.php and it does display on my contact 7 form. Oddly it display outside the form tag. this is my shortcode function cf7_shortcode() { ?> <span>test shortcode</span> <?php } add_shortcode(‘cf7_shortcode’, ‘cf7_shortcode’); also i add another line to enable shortcode to be working inside contact form template add_filter(‘wpcf7_form_elements’, ‘do_shortcode’); this is my form template <label> Nama [text* nama] </label> <label> Emel [email* emel] </label> <label> No. Telefon [tel* telefon] </label> <label> Mesej [textarea mesej] </label> <br> [cf7_shortcode] [submit « Hantar »] and this…

Get all of a user’s posts (custom post type) then get cumulative value of a specific meta_key value from those posts

I’m trying to add property values for each user on a real estate website. I have a custom post type « properties. » I’d like to take the « listing_price » from all of them and add them up to show how much that agent has for active listings. Really don’t even know where to start. I see threads to add all custom post type meta values but not for a specific user. thank you Source: https://wordpress.stackexchange.com/feeds

Set a specific default stock quantity on all WooCommerce new products

Context: I’m making a WooCommerce/Dokan marketplace for people to sell second hand products. As this are second hand products each product should have an inventory of just 1. All products are simple products, no variations. Problem I want to set by default a stock of 1 to all products. I don’t want the users dealing with setting the stock quantity by themselves. What I’ve tried I’ve done a lot of research and haven’t found a solution, I came across this online tutorial: « Set a Default Stock Quantity for WooCommerce Products« …

Web Design Weekly #367

Headlines Where did the web’s personality go? Is the internet boring now? Jake Underwood reflects on the years gone by and asks the questions, where did the web’s old personality go? Why did it leave? And how do we get it back? (invisionapp.com) What happens when you open a new install of a browser (twitter.com) Sponsor Web Design Weekly and reach over 30,042 passionate designers and developers Articles Faster Image Loading With Embedded Image Previews The Embedded Image Preview technique introduced in this article allows us to load preview images…