WP Template Parts vs CSS Styles And Scripts

WP Template Parts vs CSS Styles And Scripts

One of our major goals at OnSiteWP is to make WordPress sites easy for businesses to own. Both Mark and I enjoy digging under the hood of websites but you may not hear us “speaking geek” because we understand that our clients have better things to do than listen to us ramble about html, css, php and the like. But just because you don’t hear us spouting jargon doesn’t mean we don’t know how to. While most of our clients like to turn over the keys of their site and know that it’s going to be well taken care of, we also offer consulting services to developers who get in over their head.

I was helping a WordPress designer/developer understand how the parts of a WordPress theme relate to each other. It started as a woocommerce template question but it really applies to all WordPress themes in general.

He was working on a theme file that imported several sections with the WordPress get_template_part() function and was confused about how to apply CSS to his template part file.

get_template_part() is a fancy WordPress function that behaves like a PHP require statement at the end of the day. Once you get past this mental hurdle, the way in which you apply CSS styles and javascript selectors becomes obvious. You don’t write CSS for the template part, you write it for the final HTML output because that is how your web browser sees the page.

For added measure, I got him to pull out his inline javascript snippets and use the WordPress wp_enqueue_script() function for his custom js code. The benefit to using wp_enqueue_script() is proper dependency management.

We will never dive into these sorts of details with 98% of our clients. They want a WordPress site that is reliable, secure, and performant. But don’t be afraid to contact us with your hardest development questions. We are up for the challenge! A couple hours consulting with us is much cheaper than spending weeks of frustration on your own.

 

Reduce Distractions on Android Phones

Reduce Distractions on Android Phones

While we are a WordPress based company, we still have other technology in our lives. Today I’d like to step away from WordPress and give a productivity tip.

Lately the Facebook and Twitter apps on my phone have been alerting like crazy. Maybe that’s a good thing and signals that our OnSiteWP marketing is working. Yet still, it’s a huge distraction from important alerts to hear my phone buzz every 3 minutes. This type of problem is so common that it has a name: alert fatigue.

On Android it is possible to stop apps from sending notifications to the top menu/notification area. What you want to do is swipe down on the top menu to open up the notifications. Then long-press on the notification that you want to stop. It will open up a window like this one:

Tap the toggle switch on the Allow Notifications setting to turn off notifications for that app. Repeat this for each app that you want to silence. I did this an hour ago and I already feel so much less stress that I had to blog about it. 🙂

You need not worry about changing in-app behavior. When you open up the app it will still show notices in their usual place:

Follow us on twitter, facebook, and instagram @onsitewp if you’d like to see more business, marketing, and WordPress tips.

Convert Your WordPress Website to Use SSL and https://

Convert Your WordPress Website to Use SSL and https://

What is HTTPS and do you even need it?

Many people are looking to convert their site from plain HTTP to the secure version (HTTPS). Sometimes this is called adding an SSL certificate to your website. An SSL certificate is what makes the secure HTTPS transport possible. The “S” in HTTPS stands for secure. The SSL certificate provides the encryption key that makes the encrypted HTTPS protocol possible. (more…)

OnSiteWP