Skip to content

Instantly share code, notes, and snippets.

@zzramesses
zzramesses / gist:9045653
Created February 17, 2014 06:23
wordpress redirect
<?php header("HTTP/1.1 301 Moved Temporarily"); header("Location: ".get_bloginfo('url')); exit(); ?>
@zzramesses
zzramesses / gist:9196918
Created February 24, 2014 20:58
edd hierarchical
// make downloads hierarchical
function thesrpr_edd_make_hierarchical($download_args ) {
$download_args[] = array(
'hierarchical' => true
);
return $download_args;
}
add_filter( 'edd_download_post_type_args', 'thesrpr_edd_make_hierarchical' );
// display the top local, top unique and key varietals metaboxes in the admin area
public static function local_meta_box_display( $post, $metabox ) {
$prefix = $metabox['args']['name'];
$child_regions = hmc_get_child_regions();
$current_regions = array();
if ( get_the_terms( $post->ID, 'local_highlights' ) ) {
$current_regions = wp_list_pluck( get_the_terms( $post->ID, 'local_highlights' ), 'name' );
}
@zzramesses
zzramesses / .gitignore
Last active August 29, 2015 14:17 — forked from salcode/.gitignore
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@zzramesses
zzramesses / Off-Canvas WordPress Menu Output
Last active January 26, 2018 15:05
Foundation Off-Canvas WordPress Menu
<aside class="left-off-canvas-menu">
<?php wp_nav_menu(
array(
'theme_location' => 'the menu you want to use',
'container' => false,
'menu_id' => '',
'menu_class' => 'off-canvas-list',
'walker' => new Off_Canvas_Walker()
)
);
@zzramesses
zzramesses / post_types.php
Created February 19, 2020 03:45
post type link in gutenberg
add_action( 'init', $n( 'post_types' ) );
add_action( 'init', $n( 'rewrite_tags' ) );
add_filter( 'post_type_link', $n( 'practice_post_type_link' ), 10, 3 );
add_filter( 'post_type_link', $n( 'prescription_post_type_link' ), 10, 3 );
function post_types() {
$labels = array(
'name' => _x( 'Prescription', 'Post Type General Name', 'ws' ),
'singular_name' => _x( 'Prescription', 'Post Type Singular Name', 'ws' ),
'menu_name' => __( 'Prescriptions', 'ws' ),
{"d":{"__type":"CRMServiceWrapper.SharedLibraries.Results.RetrieveResult","RetrievedRecords":null,"Success":false,"ErrorMessage":"\r\nServer stack trace: \r\n at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)\r\n at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)\r\n at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)\r\n at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)\r\n at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)\r\n at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)\r\n at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage messag