WordPress: Custom Single Templates by Category
Create custom templates for posts in a specific category.
Create custom templates for posts in a specific category.
Here is a list of reserved usernames found on this page. I conveniently spent the 15 minutes and put them in a PHP array for you. You’re welcome!
Were we having a problem encoding a CSV to UTF-8, it was loading in the crazy characters. We tried adding BOM to the file first before we did all the ‘fputcsv’ and it worked. Hope…
Here is how you can get the YouTube Video ID from a URL no matter how many extra parameters get passed along with it. function getYouTubeIdFromURL($url) { $url_string = parse_url($url, PHP_URL_QUERY); parse_str($url_string, $args); return isset($args[‘v’])…
I was trying to get my old highlight function to highlight Russian text from a MySQL database. No Go. It was using eregi_replace which is deprecated according to the php manual. I ended up getting…
Here is my function for pagination: function createPagination($pageLink,$page,$total_pages) { if($page > $total_pages || $total_pages == 1) { return “”; } echo “<div class=”pagination”>n”; if($page != 1) { echo “<span class=’nc’><a href=””.$pageLink.($page – 1).””>< previous</a></span> …
Here is the function I have been using to make friendly url strings. The second param is your spacer. function makeURLFriendly($string,$spacer = “-“) { $newstring = strtolower($string); $newstring = preg_replace(‘/[^a-zA-Zds]+/s’, ”, $newstring); $newstring = preg_replace(‘/ss+/’,…