Skip to content

Instantly share code, notes, and snippets.

View lordmatt's full-sized avatar

Matthew lordmatt

View GitHub Profile
@lordmatt
lordmatt / wp-comment-walker
Created September 12, 2019 02:39 — forked from georgiecel/wp-comment-walker
Custom comment walker for HTML5 friendly WordPress comment and threaded replies. To be inserted in functions.php.
<?php
class comment_walker extends Walker_Comment {
var $tree_type = 'comment';
var $db_fields = array( 'parent' => 'comment_parent', 'id' => 'comment_ID' );
// constructor – wrapper for the comments list
function __construct() { ?>
<section class="comments-list">

Creating PDF thumbnails in PHP

Install Ghostscript

Download and install right version of ghostscript. In my case my PHP was x86 architecture, so I download Ghostscript 9.14 for Windows (32 bit).

Enable ImageMagick

<?php
/**
* Giving myself more functionality over this bit
*
* @author byrd
*
*/
class BetterXML extends SimpleXMLElement
{
/**