Bottle of Brass

"He shook it, and found it to be heavy, and said, I must open it, and see what is inside."

  • Gutenberg,  WordPress

    Passing a PHP Variable to a Gutenberg Block

    August 12, 2022

    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.

    Read More
    Michael Levy No Comments
  • Gutenberg,  Uncategorized

    Gutenberg Block errors that will return no or insufficient message.

    August 8, 2022

    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’

    Read More
    Michael Levy No Comments
  • Gutenberg,  Uncategorized,  WordPress

    Using custom image sizes in WordPress Gutenberg MediaUpload component

    August 3, 2022

    Read More
    Michael Levy No Comments
  • Uncategorized

    Using a Button Instead of an Input Tag to Submit with Contact Form 7

    August 21, 2015

    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…

    Read More
    Michael Levy 3 Comments
  • WordPress

    WooCommerce – breadcrumbs and multiple categories

    June 13, 2014

    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…

    Read More
    Michael Levy 4 Comments
  • php,  WordPress

    WordPress Date Archive by Post Type

    March 6, 2014

    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

    Read More
    Michael Levy No Comments
  • WordPress

    Woocommerce: Adding Cross-sells to single product template

    December 13, 2013

    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

    Read More
    Michael Levy 16 Comments
  • WordPress

    Fixing image uploading in WorPress without resorting to CHMOD 777

    July 24, 2013

    Using  CHMOD 770 on the ‘wp-content’ and ‘uploads’ folders.

    Read More
    Michael Levy No Comments
  • Poetry

    Flowers

    July 5, 2013

    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…

    Read More
    Michael Levy No Comments
  • Javascript

    Jquery hoverIntent plugin review

    April 3, 2013

    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…

    Read More
    Michael Levy No Comments
 Older Posts
Savona Theme by Optima Themes