Developer Resources

We hope these may be useful for you. If you have any feedback, problems, enhancements, or websites where you have used these -- please leave a comment on the post.

Code Snippets are solutions we have come up with to solve website development problems or ways to add enhanced features and functionality.

Some of the solutions are generic to WordPress (and Gutenberg blocks), but most are pertinent to developers working with Genesis themes and Beaver Builder plugins.

We are sharing these in the hope that what worked for us may help you in your development projects.

If you would like a free consultation regarding your project
please fill out this form

If you need immediate assistance, send me the form because I might not be able to take a phone call or text message at the moment.
But try that as well...
510.842.7438

-- Pieter Hartsook


Developer Resources & Code Snippets signup

Get weekly updates on new Developer Resources and Code Snippets posts

Please wait...

Thank you for signing up!
Emails are sent out every Monday morning
if there is new content.

Developer Resources Posts

A bit of PHP to preserve html formatting in standard WordPress excerpts 1

A bit of PHP to preserve html formatting in standard WordPress excerpts

Posted in , , ,

If you don’t use the Excerpt field in your posts and rely on WordPress to grab the first few dozen words of your post content what you usually find is the excerpt when displayed on the front end (usually in some sort of archive or post grid display) will have most of the html tags removed leaving you with a single block of plain text.

If I go to the bother of formatting my post content to make it more interesting and easier to read and understand I’d like that formatting to be preserved even in that post’s excerpt.

Read More
How to add custom post types to your default RSS feed 2

How to add custom post types to your default RSS feed

Posted in , , ,

RSS readers are somewhat old school in 2020, but the RSS feed that is part of WordPress is used by email services like Mailchimp and Mailerlite to create automated email updates when you add a new post to your website.

If you have custom post types though, they are not included in the default URL:

https://yoursite.com/feed

Read More
Storing javascript in a metabox.io Custom Field textarea 3

Storing javascript in a metabox.io Custom Field textarea

Posted in , ,

For some client projects I needed to embed javascript code in a page (Post). I used a custom field textarea to insert the code when creating the Post. The problem was the default for text fields was to run them through a sanitizer.php to strip out any type of code that might be malicious. This is a good thing. But in this case it defeats the purpose.

So how to disable the sanitizing for just this field without breaking the default?

 

Read More
Create a Scrolling Column with trivial CSS 4

Create a Scrolling Column with trivial CSS

Posted in ,

The client wanted to display a list of past events in a scrollable column. This was easy to implement using simple css. The page layout was done with Beaver Builder, but the solution should work for any html container.

Read More
Changing a Submenu to a Mega-menu with Beaver Builder 5

Changing a Submenu to a Mega-menu with Beaver Builder

Posted in , , ,

Sometimes you want to present a navigation menu as a horizontal “mega-menu” instead of a hierarchal dropdown menu. This is really simple if you are using Beaver Builder. The mega-menu feature is built in, but is unfortunately hidden. You have to know the secret to turn it on.

Read More
Formatting a custom number field to add commas 6

Formatting a custom number field to add commas

Posted in , , , ,

I needed to format a number field (999,999,999), coming from a custom field number-format (no other characters permitted in the number entry field). No “$” no commas or decimal points, etc. to output as a normal currency format.

Formatting a custom number field to add commas 7

When displaying the number I could add a “$” in front of the number, but couldn’t find a way to format the number since you can’t do that with CSS.

Read More

Code Snippets Posts

A bit of PHP to preserve html formatting in standard WordPress excerpts 8

A bit of PHP to preserve html formatting in standard WordPress excerpts

Posted in , , ,

If you don’t use the Excerpt field in your posts and rely on WordPress to grab the first few dozen words of your post content what you usually find is the excerpt when displayed on the front end (usually in some sort of archive or post grid display) will have

How to add custom post types to your default RSS feed 9

How to add custom post types to your default RSS feed

Posted in , , ,

RSS readers are somewhat old school in 2020, but the RSS feed that is part of WordPress is used by email services like Mailchimp and Mailerlite to create automated email updates when you add a new post to your website.

If you have custom post types though, they are not included

Storing javascript in a metabox.io Custom Field textarea 10

Storing javascript in a metabox.io Custom Field textarea

Posted in , ,

For some client projects I needed to embed javascript code in a page (Post). I used a custom field textarea to insert the code when creating the Post. The problem was the default for text fields was to run them through a sanitizer.php to strip out any type of code

Create a Scrolling Column with trivial CSS 11

Create a Scrolling Column with trivial CSS

Posted in ,

The client wanted to display a list of past events in a scrollable column. This was easy to implement using simple css. The page layout was done with Beaver Builder, but the solution should work for any html container.

Changing a Submenu to a Mega-menu with Beaver Builder 12

Changing a Submenu to a Mega-menu with Beaver Builder

Posted in , , ,

Sometimes you want to present a navigation menu as a horizontal “mega-menu” instead of a hierarchal dropdown menu. This is really simple if you are using Beaver Builder. The mega-menu feature is built in, but is unfortunately hidden. You have to know the secret to turn it on.

Formatting a custom number field to add commas 13

Formatting a custom number field to add commas

Posted in , , , ,

I needed to format a number field (999,999,999), coming from a custom field number-format (no other characters permitted in the number entry field). No “$” no commas or decimal points, etc. to output as a normal currency format.