PHP Conditional Region Based on Recordset Empty or Not Empty

I hope this helps someone, I spent way too many hours on it. I’m sure it’s simple for all you super code cooks, but for some (me) it can sure mess up your day.

  • If your recordset IS empty use this ==”” (equals nothing)
  • If your recordset is NOT empty use this >”” (is greater than nothing)

Here are some examples:

if ($row_rs_showif[‘this_url_img’]==””){
// Do Something }

if ($row_rs_showif[‘this_url_img’]>””){
// Do Something }

Templates for Simple Portfolio

If you want to add category and client templates to the WordPress plugin Simple Portfolio (by Patrick Brouwer) make sure you use the custom Taxonomies created by the plugin.

To find the two taxonomies that you’ll need go to the plugin’s folder and open simple-portfolio.php and search for “taxonomy”. You’ll fine the two that you’ll need:

  • portfolio-clients
  • portfolio-categories

In order to get my new template files to work in my theme I named my files this:

  • taxonomy-portfolio-categories.php
  • taxonomy-portfolio-clients.php

Hope this helps.