Skip to content
Joe Casabona

Joe Casabona

  • About
  • Feed
  • Uses
  • Podcast
  • Coaching
  • Now
Joe Casabona
Joe Casabona
Home / php
  • Code | Quick Tips

    WordPress Helper Functions for Detecting IE

    March 3, 2016

    The other day I was working on a problem where I wanted to check if a website was using a specific browser (in this case IE) and version (in this case 9 or below). I came up with 2 functions that would serve an a nice, reusable check for both. These can also be extended to check for other browsers or versions, or even accept custom regular expressions.

    Read More “WordPress Helper Functions for Detecting IE”

  • Code | Quick Tips

    Add IE Conditionals to wp_enqueue_style

    September 15, 2016

    When creating a WordPress theme, it’s best practice to use wp_enqueue_style for adding all stylesheets, including style.css. At first glance, this can pose a challenge if you want to conditionally include CSS based on the browser (like IE-only styles, for example). Luckily, there is a quick way to do this in WordPress using $wp-styles:

    global $wp_styles;
    wp_enqueue_style( 'jlc_ie_styles',get_template_directory_uri() . 'css/ie-style.css', array(), '1.0.0' );
    $wp_styles->add_data( 'jlc_ie_styles', 'conditional', 'IE' );
    

    The code above calls on the $wp-styles class to associate our IE-only stylesheet (by tag/name/slug) with a condition, the condition being “IE.” If you wanted IE 9 and below, you could do this:

    $wp_styles->add_data( 'jlc_ie_styles', 'conditional', 'lte IE 9' );

    This is a great (and best practice) way to conditionally call styles. You can see more examples with comments over in this gist by wpscholar.

  • Quick Tips

    Quick Tip: Check to See if a Slug Exists in WordPress

    September 14, 2014

    Recently I was doing some work where I was importing RSS entries into a Custom Post Type in WordPress. Since there were no common IDs between the feed and WordPress, to prevent duplicate entries I tried comparing titles. This also proved to be an issue as titles aren’t always unique, and they weren’t in this case. I settled on comparing slugs; WordPress creates a unique slug for each post from the title, and there’s a way to know what that slug is going to be before the post is added.

    Read More “Quick Tip: Check to See if a Slug Exists in WordPress”

  • Gear | Random Thoughts

    Don’t be Afraid to Relearn

    April 26, 2014

    Just the other day I picked up a new book called PHP: The Good Parts. I’ve been programming PHP for over 10 years, and the book covers a lot of beginner topics like control structures, variables, etc. However, there is some stuff towards the end that will be of great value. I plan on reading the (short) book cover-to-cover. Why you ask? I feel like I have to; after so many years, there are some things I should relearn the right way.

    Read More “Don’t be Afraid to Relearn”

  • Books

    Good Books for Web Development

    November 29, 2013

    I’m teaching a couple of web development classes this semester and have been receiving a lot of questions as to what books would serve as good resources. Here’s a short list, starting with the ones I’ve chosen for my classes.

    1. HTML and CSS: Design and Build Websites: This is possibly the best book I’ve used for HTML and CSS. It is visual, puts things in simple terms, and it’s up-to-date. I would strongly recommend this for beginners. I am using it for my E-Commerce 251 (Intro to E-Commerce) course.
    2. Web Database Applications with PHP and MySQL: This book (by O’Reilly Media) takes a good look at PHP and MySQL. It covers a range of topics from beginner PHP and an intro to Databases to a look at bigger topics, like security. I’m using it for my Media Info Tech 315 (Web Applications and Databases) course.
    3. Bulletproof Web Design: Improving flexibility and protecting against worst-case scenarios with HTML5 and CSS3: This book taught me everything I know about the right want to develop websites. Dan Cederholm is a pro and a great teacher who will take you through doing things, and making them bulletproof.
    4. Web Designer’s Guide to WordPress: Plan, Theme, Build, Launch: Once you’re comfortable with HTML, CSS, and PHP, you might want to get into WordPress. This book is an excellent starting point.
    5. Implementing Responsive Design: Building sites for an anywhere, everywhere web: Responsive Design is all the rage now, and for good reason. This book will tell you the principles of RWD and how to implement it in your site.
    6. The A Book Apart Books: Honestly I would recommend all of them, but the specifically web development ones are: HTML5 for Web Designers, CSS3 for Web Designers, Responsive Web Design, and Mobile First. 

    As you probably know, I also have a book, Building WordPress Themes from Scratch. However, there have been some changes the publisher has been doing lately and I am working with them to get the book in my hands. More on that here.

    Finally, I have another book coming out in December called Responsive Design with WordPress. I think this would work really well after books 4 and 5 on the above list. Keep an eye out for it; maybe I’ll even do a giveaway or two.

    What are your must-read web development books? Let me know in the comments!

  • Links

    Interesting Links for June 21, 2013

    June 21, 2013

    Happy 1st official day of summer. The Internet has been particularly good this week so I wanted to share some of the interesting links I’ve come across.

    Read More “Interesting Links for June 21, 2013”

  • Code | Design | Links | Websites

    Web Development Resources, Summer 2013

    June 19, 2013

    I have a ton of bookmark folders to help keep myself organized, though to be honest I usually bookmark something and then forget about it. So, while looking through some of my folders, I can across a good amount of web development resources I’ve been keeping. I’ve decided to share them.

    Read More “Web Development Resources, Summer 2013”

  • Speaking

    My Slides from PABUG 2012

    November 20, 2012

    Here you go! My slides from my talk, “Using PHP to Create a Web-­Based Mobile Banner Application” from @PA_BUG are available for download (links to my Public Dropbox folder). There is also a link to our current mobile app.  Thanks to everyone who came out, and to PABUG for having me!

    • Slides (pdf)
    • Slides (ppt)
    • Mobile Web App

    If you have any questions or comments/please email me at joseph.casabona@scranton.edu.

  • Links

    Links Round Up for 10/31/10

    October 31, 2010
    • Super-Toys Last all Summer Long: Fun that he wrote this 2 days after I bought mine. He’s dead on about sharing though. There needs to be an easier way. Full review from me coming soon.
    • Bypass Facebook Fan Pages: Can we all stop liking those stupid pages now?
    • Nordstrom’s Employee Handbook- short and sweet: If I ever have a full on company, my employee handbook will be similar. I hate stupid, pointless rules.
    • 6 Secret Monopolies You Didn’t Know Run the World: I know I started on the 2nd page, but #3 is the most important one (for all of you fanboys out there).
    • Nation Disappointed by Great World Series Matchup: Incredibly true. Anyone who’s said this is a bad World Series is clearly only a Yankees or Phillies fan, not a baseball fan. [note: I’m a Yankees fan, but I love good baseball.]
    • Ron Howard Explains Keeping “Gay” Joke in The Dilemma: There are so many other more important things people should be getting mad about. If you don’t like something said in a movie, don’t see that movie!
    • Really Really Bad Headline: This happens too much.
    • Dribble – Utah: Great designs here. I wish I could do stuff like this.
    • PHP SOAP Extension: I had to do some work with SOAP this week and found this link to be helpful. I’ll also probably do a full write up on using SOAP with PHP and the problems I ran into.
  • Code | Quick Tips

    Quick Tip: Custom Category Styles in WordPress

    August 17, 2010

    Over the weekend I revamped this blog’s current theme a little bit, including adding custom styles for my Link Round-up lists. I achieved this by adding a simple piece of code within my loop to make each category a CSS class. Here’s how I did it.

    Note: You need to be at least a little bit familiar with the WordPress API, and coding themes.

    Read More “Quick Tip: Custom Category Styles in WordPress”

Page navigation

1 2 3 Next PageNext

Stop Wasting Your Time Fighting
the Tech Stack

(and use it to your advantage instead)

Join hundreds of business owners who are building simple, powerful systems through automation.

  • YouTube
  • LinkedIn
  • Gravatar
  • RSS Feed
Search
  • What I Use
  • Press & Media
  • Gift Guides
  • Buy Me Coffee
Joe Casabona Est. 1985 Monogram

© 2004 - 2026 Joe Casabona | Affiliate and AI Disclosures

I may receive a small commission from purchases made from certain links on this site.

  • About
  • Feed
  • Uses
  • Podcast
  • Coaching
  • Now