Placing border inside of div and not on its edge

div{
  box-sizing:border-box;
  -moz-box-sizing:border-box;
  -webkit-box-sizing:border-box;
  width:100px;
  height:100px;
  border:1px solid red;
}

Featured Image Thumbnail Sizes

The default image sizes of WordPress are "thumbnail", "medium", "large" and "full" (the size of the image you uploaded). These image sizes can be configured in the WordPress Administration Media panel under Settings > Media. This is how you can use these default sizes with the_post_thumbnail():
the_post_thumbnail();                  // without parameter -> 'post-thumbnail'
 
the_post_thumbnail( 'thumbnail' );       // Thumbnail (default 150px x 150px max)
the_post_thumbnail( 'medium' );          // Medium resolution (default 300px x 300px max)
the_post_thumbnail( 'large' );           // Large resolution (default 640px x 640px max)
the_post_thumbnail( 'full' );            // Full resolution (original size uploaded)
 
the_post_thumbnail( array(100, 100) );  // Other resolutions

Remove space on file name before or after stored in databases

Use str_replace(), it will replace all occurrences of the search string with the replacement string.
str_replace(" ","",$oldname);

Onclick redirect to a link instead of using a href

The following works fine for me, let me know if you need more.
HTML
<button id="promoCodeSubmit" onclick="ClickEvent()">Apply</button>
<input type="hidden" id="promoCodeValue" value="1"/>
JS
function ClickEvent(){
    window.location.href='http://www.test.com';
}

Custom Css for category in wordpress


<div class="post <?php
foreach((get_the_category()) as $cat) {
echo $cat->cat_name . '';
} ?>">
...
</div>