Ben Rothman - WordPress Developer WordPress Archives - Page 3 of 5 - ©2023 Ben Rothman, Web Developer

Blog

My blog is dedicated to sharing my expertise, recommendations, and tutorials on WordPress. If you're interested in developing with WordPress, my blog is a valuable resource that you won't want to miss.

Categories
Web Development WordPress

Adding User-Specific Content to a WordPress page

There are many ways to go about this but in this post I will be focusing on using php in your WordPress page template to add content that can only be seen by users who are logged into administrator accounts.

Let’s say we have a secret message for administrators “The prize is behind door number 2”. We don’t want to share this invaluable, secret message with just anyone, we only want our friends who have administrator accounts on our website to be able to see the message.

We can create this functionality easily with WordPress using some of it’s many defined PHP functions. All we have to do are the three lines of code below:

if ( is_admin() ) {
     echo 'The prize is behind door number 2';
}

We can also use this same method with a different function to require the user to be logged in to see the message:

if ( is_user_logged_in() ) {
     echo 'The prize is behind door number 2';
}

We can even use this technique to show the message to a specific user and no one else, for a personalized message or something using the code below:

if ( '3' == get_current_user_id() ) {
     echo 'The prize is behind door number 2.';
}

I hope these three short examples demonstrate to you how powerful WordPress custom code using the pre-defined functions can be. Using a relatively small amount of code, I can extend this functionality to add some really useful new features to my website and so can you. Happy WordPressing!

Categories
Plugin Web Development WordPress

Fixed ChatPress

I installed ChatPress on a website with a new theme today and it looked squished and strange. It was still legible and everything but the whole appearance just looked a little sloppy to me. I’m sure some people would have told me the plugin looked fine and that whether it works or not (which it always did) was more important.

Functionality alone is not enough for me, so I went to work diagnosing the problem and creating a fix. I found that the problems were CSS-related so I went to my scss files, made the changes and recompiled my scss into css so that I could use them for the plugin and voila, it was fixed!

Categories
Plugin WordPress

WordPress: Formidable Forms

If you want a complex form with conditional logic, advanced scoring, user registrations and much more, Formidable Forms is the plugin for you. If you want a contact form this plugin works excellently for that too, it’s much more power than you need but it is a good solution.

Formidable forms has an easy-to-use graphical interface to build forms, and then can add conditional logic/assign scores or values to responses right there. If you need to refer to the value of a field in the value of another field, email it or otherwise use it elsewhere in the form, you can just refer to the index number associated with that field or use a url parameter right in the Formidable Forms interface.

If you need complicated and very powerful forms on your site and do not want to build them with code then this is the plugin for you.

There is even a very useful API add-on that I used at work to create API sends to specific endpoints and with specific data including but not limited to the data entered on the form.

Categories
WordPress

WordPress 5.5 “Eckstine”

Here it is! Named “Eckstine” in honor of Billy Eckstine.


Speed

Posts and pages feel faster, thanks to lazy-loaded images.

Images give your story a lot of impact, but they can sometimes make your site seem slow.

In WordPress 5.5, images wait to load until they’re just about to scroll into view. The technical term is ‘lazy loading.’

On mobile, lazy loading can also keep browsers from loading files meant for other devices. That can save your readers money on data — and help preserve battery life.

Say hello to your new sitemap.

WordPress sites work well with search engines.

Now, by default, WordPress 5.5 includes an XML sitemap that helps search engines discover your most important pages from the very minute you go live.

So more people will find your site sooner, giving you more time to engage, retain and convert them to subscribers, customers or whatever fits your definition of success.

Security

Now you can choose to update plugins and themes automatically–or pick just a few–from the screens you’ve always used.

Auto-updates for Plugins and Themes

Now you can set plugins and themes to update automatically — or not! — in the WordPress admin. So you always know your site is running the latest code available.

You can also turn auto-updates on or off for each plugin or theme you have installed — all on the same screens you’ve always used.

Update by uploading ZIP files

If updating plugins and themes manually is your thing, now that’s easier too — just upload a ZIP file.

Categories
Website WordPress

WordPress: WPOptimize

This life-saver plugin adds a button to the dashboard when installed that allows the administrator of the website to perform certain site optimization tasks such as removing old post revisions, minifying images, removing trashed comments and lots more from the comfort of their own dashboard.

Want to optimize the tables in your database? No problem, just install this handy plugin and with no configuration required you can do that with just the click of a button. If you have a WordPress site and want a boost in performance, as long as the issue(s) causing the slowness are not very uncommon and strange, this is the plugin for you.

Categories
WordPress

WordPress 5.4 “Adderly”

Categories
Travel WordCamp WordPress

WordCamp Montreal 2019

This was the last WordCamp I attended before COVID and little did I know but it was just under the wire. I went to this event with my friend Evan who goes with me to many of the fun WordCamp events.

This event was held right nearby where I was staying at the John Molson School of Business building at Concordia University. Aside from having a nice venue, there were interesting talks about the UX, generating revenue, the JAM Stack and much more.

It was cool to visit another country and then to also learn about WordPress, the thing I love. We had friends who lived in the area who knew of some great places to eat and visit. I had a great time, and I hope all of my future WordCamp experiences are that great.

Categories
Project WordPress

Hosted WordPress Site on raspberry pi

I know this is a deviation from my normal posts but I had to say something because I enjoyed this exciting project.

I used a raspberry pi to host a WordPress website on my local network. Granted, this would have been a better announcement if the website was available everywhere, but I just wanted to set up a headless installation of Ubuntu on Raspberry pi, SSH in from one of my other computers and host a website on the pi.

To be honest, technologically this was nothing special I suppose because it was not a complex website but the site I made was not a complex site, but this was an interesting project.

Categories
Web Development WordPress

Introducing WPMonitor!

WP Monitor is a plugin I made to solve a common issue that I had at one of my jobs (and yes this is on the WordPress public repository). WPMonitor is the quick and easy way to manage multiple sites from the dashboard.

WP Monitor makes a dashboard widget that uses javascript libraries and color indicators, creates an at-a-glance health check for your site, telling you how many plugin updates, theme updates, core updates, PHP version, SSL, and lots of other key information for maintaining a WordPress website! The best part is that with a single click you can create a print out or pdf (for a paperless option) to get reports on all 20 of the sites you manage in 2 minutes.

The plugin is free and, as I said, solved a common issue I had at work. Never again spend your time looking for each vital statistic on your WordPress website for maintainance, just use WP Monitor to get the information quickly and easily.

Categories
Project Web Development WordPress

Introducing ChatPress!

Hey everyone! ChatPress is a plugin that I am working on that creates chatrooms on any page that they are put on in a WordPress website. I did not put this in the plugin repository because it is more of a personal project, but it was a lot of fun to create.

The plugin uses asynchronous javascript calls to PHP functions to get every message from the server, separate out the messages for other chatrooms and then post all of those that are left. I definitely recommend checking out this plugin, and it is also on my github if you want to see the code or contribute a new feature!