Adding a body class based on url in address bar
<p><strong>Problem</strong></p>

<p>I want to add <code>body</code> classes to two separate types of pages:</p>

<p>1) Pages that match this url: <code>example.com/shop/</code></p>

<p>2) Pages that have anything after <code>/shop/</code> in the url: <code>example.com/shop/asdfjkl, example.com/shop/item-2342, etc.</code></p>

<hr>

<p>So far, I've solved the first problem by using this code:</p>

<pre><code>  if(window.location.href.match('example.com/shop/')){
    jQuery('body').addClass('shop');
  }
</code></pre>

<p>However, this also adds the <code>shop</code> class to any url that starts with <code>example.com/shop/</code> <em>(refer to problem #2)</em></p>

<hr>

<p><strong>Question</strong></p>

<p>How can I add a separate <code>shop-item</code> class to just the urls that have characters <em>after</em> <code>/shop/</code>?</p>