Skip to content

Instantly share code, notes, and snippets.

View kLOsk's full-sized avatar
:octocat:
back in black

Daniel Klose kLOsk

:octocat:
back in black
View GitHub Profile
@kLOsk
kLOsk / gist:2b0123c2fca5538eb3f6ab8856411301
Last active October 31, 2017 23:24
WP Post Views for WPEngine - Count Post Views in WordPress without plugin
<?php
if ( ! defined("POST_VIEWS_KEY") ) {
define("POST_VIEWS_KEY", "post_views_count");
}
// function to display number of posts.
function get_post_views( $post_id ){
<?php
//Remove CPT's
function dk_delete_post_type(){
unregister_post_type( 'beers' );
}
add_action('init','dk_delete_post_type');
//Custom Permalinks and Rewrites
function wpa_show_permalinks( $post_link, $post ){
if ( is_object( $post ) && $post->post_type == 'event' ){