Skip to content

Instantly share code, notes, and snippets.

Mark Wilkinson wpmark

Block or report user

Report or block wpmark

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View wpmark-page-children-shortcode.php
<?php
/*
Plugin Name: wpamrk Page Children Shortcode
Plugin URI: http://markwilkinson.me
Description: A shortcode that outputs the current pages children either with or without their featured image.
Version: 0.1
Author: Mark Wilkinson
Author URI: http://http://markwilkinson.me/
*/
@wpmark
wpmark / gist:9069976
Created Feb 18, 2014
Change Whistles WordPress Plugin Post Type Labels
View gist:9069976
<?php
/***************************************************************
* Function pxlcore_whistles_post_labels()
* Changes the post labels for the Whistles post type.
***************************************************************/
function pxlcore_whistles_post_labels( $labels ) {
$labels->name = 'Snippets';
$labels->singular_name = 'Snippet';
$labels->menu_name = 'Snippets';
@wpmark
wpmark / gist:9076729
Created Feb 18, 2014
List Children Shortcode Example
View gist:9076729
[wpmark_list_children images="true"]
View show-admin-display-hooks.php
<?php
/*
Plugin Name: Show Admin Display Hooks
Plugin URI: http://github.com/wpmark/show-admin-display-hooks
Description: Make visible all the hooks in the WordPress admin area that are available for outputting content on different admin screens.
Version: 0.1
Author: Mark Wilkinson
Author URI: http://markwilkinson.me
License: GPLv2 or later
*/
View widget-starter.php
<?php
/******************************************************************************************
* Class sensl_whistles_widget
* Builds the widget for adding post content to widgetized area extending WP_Widget
******************************************************************************************/
class MDW_Widget extends WP_Widget {
function mdw_widget() {
$widget_ops = array(
@wpmark
wpmark / wp-tag-cloud-args.php
Created Jun 22, 2014
Filter the Output of WordPress Tag Cloud Widget
View wp-tag-cloud-args.php
<?php
function wpmark_widget_tag_cloud_args( $args ) {
$args[ 'smallest' ] = '1.5';
$args[ 'largest' ] = '1.5';
$args[ 'unit' ] = 'em';
return $args;
}
@wpmark
wpmark / null-instagram-widget-output.php
Last active Aug 29, 2015
Null Instagram Widget Output in Template File
View null-instagram-widget-output.php
<?php
/* output instagram widget */
the_widget(
'null_instagram_widget',
array(
'username' => 'username',
'title' => '',
'number' => '1',
'size' => 'large',
'target' => '_blank',
@wpmark
wpmark / registered_post_type.php
Created Sep 23, 2014
Alter the Registered Post Type Args for Any Post Type
View registered_post_type.php
<?php
/***************************************************************
* Function bct_make_whistles_public()
* Sets the whistles post type to be public
***************************************************************/
function bct_make_whistles_public( $post_type, $args ) {
/* only proceed for the whistles post type */
if ( 'whistle' != $post_type )
return;
@wpmark
wpmark / gist:292d91a50c6c9bafa009
Created Sep 23, 2014
Registered Post Type Args
View gist:292d91a50c6c9bafa009
object(stdClass)#386 (26) {
["labels"]=>
object(stdClass)#373 (14) {
["name"]=>
string(8) "Whistles"
["singular_name"]=>
string(7) "Whistle"
["add_new"]=>
string(7) "Add New"
["add_new_item"]=>
@wpmark
wpmark / gist:aa388261d0ef58938218
Last active Aug 29, 2015
Show Only 5 Blog Posts on Home Page
View gist:aa388261d0ef58938218
<?php
/***************************************************************
* Function wpmark_alter_homepage_posts_query()
* Alter query on homepage for show just 5 posts
***************************************************************/
function wpmark_alter_homepage_posts_query( $query ) {
/* check this is not the main query, the admin - if so bail early */
if( ! $query->is_main_query() || is_admin() )
return;
You can’t perform that action at this time.