• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Twitter GitHub
You are here: Home / Archives for WordPress

WordPress

Conditionally Add Bootstrap Table Responsive Class

Last updated on April 16, 2019 by Sal Ferrarello

While working on another post, I had some very large tables and I wanted to use Bootstrap Responsive Tables by adding the .table-responsive class but only in the situation where the table is too wide. This is the code I used.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: Bootstrap, Genesis, WordPress

How to Set Older WordPress Posts to Draft with WP CLI

Last updated on April 5, 2019 by Sal Ferrarello

In one of the slack channels I follow, the question came up on how to set WordPress posts older than a certain date to “draft” status using with WP CLI. I was surprised by how difficult I found this task and wanted to document my solution.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: WordPress, wp-cli

ACF Uncaught TypeError: Cannot read property ‘id’ of undefined

Last updated on April 8, 2019 by Sal Ferrarello

Recently I was working on a site using Advanced Custom Fields (ACF) and the field input boxes had stopped working. In the browser console, I saw the error “ACF Uncaught TypeError: Cannot read property ‘id’ of undefined”.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Solution Tagged With: ACF, Advanced Custom Fields, WordPress, WordPress Plugin

WordPress JavaScript async defer

Last updated on February 11, 2019 by Sal Ferrarello

When loading JavaScript on a webpage with the “script” tag, there are additional attributes you can add to tell the browser how and when to load the JavaScript (‘async’ and ‘defer’). In WordPress, there is not a native way to add these attributes but this code snippet does the trick.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Programming, Solution Tagged With: HTML5, JavaScript, WordPress

Install a non-wordpress.org Plugin with WP CLI

Last updated on November 19, 2018 by Sal Ferrarello

The WordPress plugin repository at wordpress.org/plugins is a great resource. I often use WP CLI to install plugins on my WordPress site from there, however, sometimes I want to install other plugins with WP CLI.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: WordPress, WordPress Plugin, wp-cli

Override WordPress Publish Date on Creation

Last updated on November 5, 2018 by Sal Ferrarello

When creating new posts for a video demonstration, I wanted to display a consistent date. While my first thought was to reset my system clock, this snippet overrides the date when the post is first created, which worked for me.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Presentation Tagged With: WordPress, WordPress Filter

Construction Works on Scaffolding.

WordPress Core Development on Local by Flywheel

Last updated on October 26, 2018 by Sal Ferrarello

I setup a site for WordPress Core development with Local by Flywheel and documented the steps. If you’re trying to do the same, this might be helpful.

Filed Under: Dev Tips, Programming Tagged With: WordPress, WordPress Core

Prevent WordPress Auto Embed

Last updated on October 22, 2018 by Sal Ferrarello

In one of my other posts I am displaying some URLs on their own line as part of the content however the WordPress oEmbed functionality is turning these into rich HTML. I was able to suppress this by wrapping the URLs in HTML span tags.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Solution Tagged With: oEmbed, WordPress

Full Post on Blog Archive

Last updated on October 15, 2018 by Sal Ferrarello

On a WordPress project, I wanted to display the full post on the blog archive unless a manual excerpt had been created for the post (in which case I wanted to use the manual excerpt). Here is the code I used to make this happen.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Programming, Solution Tagged With: excerpt, WordPress

WordPress Image Array of Attributes

Last updated on September 4, 2018 by Sal Ferrarello

When working with a WordPress image, I wanted the attributes for the image. The function `wp_get_attachment_image()` provides me everything I need but in a rendered HTML string, rather than a more useful array of attributes. I was surprised I was unable to locate a good way to get this information, so I wrote this code to help me.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Programming, Solution Tagged With: WordPress

  • «Previous Page
  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Go to page 5
  • Interim pages omitted …
  • Go to page 11
  • Next Page»

Copyright © 2021 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in