My challenge was how to apply a background image to a <div> in the Gutenberg admin panel. My solution was to add a variable to the head of the document that could be referenced in the block’s Javascript. The background image was then hardcoded as an inline style.
-
-
Gutenberg Block errors that will return no or insufficient message.
The ‘save’ function wrapper HTML class attribute used the word ‘class’ instead of ‘classname’. Trying to link dynamic register script to js block. No errors just don’t work. block referenced but does not exist (not linked in block js) “http://localhost/vpf2/wp-admin/undefined 404 (Not Found)” [ ‘core/heading’, { placeholder: ‘Enter the main heading’, level: 1 } ] ‘Level needs to be numeric’
-
Using custom image sizes in WordPress Gutenberg MediaUpload component
-
Using a Button Instead of an Input Tag to Submit with Contact Form 7
The markup on a form used a <button> tag rather than a <input> which is used by default. I read several articles that suggested things like hacking the core files of the plugin, but really it is a lot simpler than that. The classes on the submit input are the identifiers used to trigger the JavaScript validation and Ajax submission. Here is…
-
WooCommerce – breadcrumbs and multiple categories
When there are multiple possible breadcrumbs, WooCommerce picks the first possibility. If the product is found from following a different path, the breadcrumbs no longer match the expected order. To make the breadcrumbs match the path used to reach the product I used the following strategy: Use a cookie to record the last visited product archive page. On the single…
-
WordPress Date Archive by Post Type
Adding the post type in the archive query string displays the relevant posts. It is that easy! my-wordpress-site.com/2014/3/?post_type=legend
-
Woocommerce: Adding Cross-sells to single product template
The client wanted to hand-pick which related products would be visible on the product pages. So I replaced ‘related products’ with ‘cross sells’. Step 1: get the ids of the cross sell products using the ‘_crosssell_ids’ meta key. Step 2: Loop through the products by id
-
Fixing image uploading in WorPress without resorting to CHMOD 777
Using CHMOD 770 on the ‘wp-content’ and ‘uploads’ folders.
-
Flowers
Flowers in wine bottles Cheerful and brilliant I bought them before you came for dinner We finished my wine From the refrigerator in my old house Our conversation was awkward Connections not fitting But our limbs fit togethor well Giving each other comfort We filled each other up You canceled our next trist Which saved me from canceling The flowers…
-
Jquery hoverIntent plugin review
Drop down menus allow users to explore deeply into a site without being overwhelmed with a lengthy list of links. Sadly, these elements can frustrate users when following a trail of panels becomes a game of dexterity. They can also be inadvertently triggered by a stray mouse, blocking content. HoverIntent, by Brian Cherne, is a jQuery plugin that interprets users…