Skip to content

Instantly share code, notes, and snippets.

@zzramesses
zzramesses / gist:9045653
Created Feb 17, 2014
wordpress redirect
View gist:9045653
<?php header("HTTP/1.1 301 Moved Temporarily"); header("Location: ".get_bloginfo('url')); exit(); ?>
View gist:9196918
// 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' );
View HMC Clause Custom Metaboxes
// 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' );
}
View .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 Jan 26, 2018
Foundation Off-Canvas WordPress Menu
View Off-Canvas WordPress Menu Output
<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 Feb 19, 2020
post type link in gutenberg
View post_types.php
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' ),
View gist:8b274e0b163739e9ce6a38d2082d89b8
{"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