Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View reinnovating's full-sized avatar

Joi reinnovating

View GitHub Profile
@reinnovating
reinnovating / function.php
Last active November 15, 2017 09:34 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
// Add to existing function.php file
// Disable support for comments and trackbacks in post types
function df_disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ($post_types as $post_type) {
if(post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
@devinsays
devinsays / post-type-metaboxes.php
Last active June 4, 2022 06:34
Example code shows how to register a post type and add basic metaboxes.
<?php
/**
* Example code for tutorial post on custom meta boxes:
* https://wptheming.com/2010/08/custom-metabox-for-post-type/
*/
/**
* Registers the event post type.
*/
function wpt_event_post_type() {
@andrewlimaza
andrewlimaza / my_pmpro_dequeue_scripts.php
Last active April 6, 2018 11:43
Load script/styles for specific pages only (PMPro member directory and PMPro Checkout page for Register Helper)
<?php
//copy the code below into your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
function my_pmpro_remove_enqueues(){
if( !is_page( 'your-page-id-goes-here' ) ){ //change page ID to match your directory page - Member Directory Add-on code
wp_deregister_style( 'pmpro-member-directory-styles' );
}
@thefuxia
thefuxia / basic_meta_box.php
Last active September 2, 2021 16:22
WordPress meta box example
<?php # -*- coding: utf-8 -*-
declare( encoding = 'UTF-8' );
/**
* Plugin Name: Basic Meta Box
* Description: Create a simple meta box. Demo plugin.
* Version: 2012.02.05
* Required: 3.3
* Author: Fuxia Scholz
* Author URI: https://fuxia.me
* License: GPL
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@davatron5000
davatron5000 / videos.php
Created February 28, 2011 23:06
WordPress Custom Post Type Boilerplate (e.g. Videos)
<?php
/*
Plugin Name: Videos
Plugin URI:
Author: Dave Rupert
Author URI: http://www.daverupert.com
Description: A custom post type that adds videos and custom taxonomies.
Version: 1.0
*/