functons.php Posts

Formatting a custom number field to add commas 1

Formatting a custom number field to add commas

By Pieter Hartsook / February 9, 2020 / 0 Comments
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. 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
How to add custom post types to your default RSS feed 3

How to add custom post types to your default RSS feed

By Pieter Hartsook / March 27, 2020 / 0 Comments
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
A bit of PHP to preserve html formatting in standard WordPress excerpts 4

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

By Pieter Hartsook / March 30, 2020 / 0 Comments
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 […]

Read More
Simple History plugin banner

Shorten the length of the log file for Simple History plugin

By Pieter Hartsook / July 21, 2020 / 0 Comments
Posted in , ,

The Simple History plugin default history period is 60 days. The log includes not only user initiated changes to the website, but all the automated updates to plugins, etc. This can make the log file pretty large.

Read More
How to add CSS to control elements on the back end of your WordPress site 5

How to add CSS to control elements on the back end of your WordPress site

By Pieter Hartsook / March 3, 2021 / 0 Comments
Posted in , , ,

Let’s say you want to style the dashboard, or hide an element that normally shows when editing a Post using display:none;. Even if you can discover the CSS selector using your browser’s inspector and test out your custom styling, you can’t just copy and paste that into the WordPress Customizer. something

Read More
Skip to content