Skip to content

Instantly share code, notes, and snippets.

View patrikthors's full-sized avatar

Patrik Thors patrikthors

View GitHub Profile
@BronsonQuick
BronsonQuick / add_custom_classes_tinymce_wordpress.php
Last active August 19, 2024 02:35
Add custom classes to TinyMCE in WordPress because I hate shortcodes :)
<?php
/* Add the Style Dropdown Menu to the second row of visual editor buttons
* N.B. Make sure you include your custom classes in both your style.css AND editor-style.css :)
*/
function pico_themes_mce_buttons( $buttons ) {
array_unshift( $buttons, 'styleselect' );
return $buttons;
}
/* Alternative Header Graphics
------------------------------------------------------------ */
.single #header,
.header-wrench #header {
background: #fff url(images/header-bg-single.jpg) repeat-x;
}
.single #header .wrap,
.header-wrench #header .wrap {
@awshout
awshout / foundation3-navbar-menu.php
Last active October 13, 2021 17:07
WordPress Menu & Walker for ZURB's Foundation 3 Nav Bar
<?php
add_theme_support('menus');
/*
http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus( array(
'main-menu' => 'Main Menu' // registers the menu in the WordPress admin menu editor
) );
@Abban
Abban / WordPress Theme Customizer Sample.php
Created June 21, 2012 21:09
WordPress Theme Customizer Sample
<?php
function themename_customize_register($wp_customize){
$wp_customize->add_section('themename_color_scheme', array(
'title' => __('Color Scheme', 'themename'),
'priority' => 120,
));
// =============================
@bueltge
bueltge / set-featured-image.php
Created June 14, 2012 12:41
Set featureed image automaticly on save post/page
@fedemp
fedemp / featured-page-widget.php
Created April 3, 2012 01:08
featured-page-widget edited cause it breaks on one of my projects
@mikeschinkel
mikeschinkel / rootbased-taxonomy-urls.php
Created March 26, 2012 04:29
Root-based Taxonomy URLs Plugin for WordPress
<?php
/*
* Plugin Name: Root-based Taxonomy URLs for WordPress
* Description: Enables root-based Taxonomy URLs, i.e. Makes /taxonomy/my-taxonomy/ URLs route as /my-taxonomy/
* Author: Mike Schinkel
* Author URI: http://about.me/mikeschinkel
* Plugin URI: https://gist.github.com/1421235
* Version: 0.1
* License: GPL 2+
* Notes: Must use register_root_based_taxonomy_url( $taxonomy[, $priority] ) in an 'init' hook to specify root_based taxonomy.
@billerickson
billerickson / gist:2040968
Last active February 22, 2017 01:56
Grid Loop using post class
<?php
/**
* Archive Post Class
* @since 1.0.0
*
* Breaks the posts into three columns
* @link http://www.billerickson.net/code/grid-loop-using-post-class
*
* @param array $classes
@mikeschinkel
mikeschinkel / functions.php
Created February 3, 2012 07:43
Master WordPress Custom Post Types - WordCamp Atlanta 2012
<?php
/*
* Code Examples for Master WordPress Custom Post Types - WordCamp Atlanta 2012
*
* Author: Mike Schinkel
* Author URI: http://about.me/mikeschinkel
*
*/
add_action( 'init', 'mikes_theme_init' );
function mikes_theme_init() {
@jbreitenbucher
jbreitenbucher / widgets.php
Created January 20, 2012 20:44
Genesis: Customization of Featured Page and Post Widgets
<?php
/** Remove the Genesis Featured Post widget */
add_action( 'widgets_init', 'faculty_unregister_widgets' );
function faculty_unregister_widgets() {
unregister_widget( 'Genesis_Featured_Post' );
unregister_widget( 'Genesis_Featured_Page' );
}
add_action('widgets_init', create_function('', "register_widget('Faculty_Featured_Post');"));
add_action('widgets_init', create_function('', "register_widget('Faculty_Featured_Page');"));