Skip to content

Instantly share code, notes, and snippets.

@ginocremer
ginocremer / Add Image Size WordPress
Created March 21, 2014 07:42
Add Image Size WordPress
add_image_size( 'neues-mass', 1600, 1200 );
function Pixelbar_AddSpellChecker($initArray){
$initArray['spellchecker_languages'] = '+Francais=fr, +Deutsch=de, English=en';
return $initArray;
}
add_filter('tiny_mce_before_init', 'Pixelbar_AddSpellChecker');
<link rel="shortcut icon" href="/pfad/zum/favicon.ico">
add_filter('widget_text', 'gibmirphp', 99);
function gibmirphp($text) {
if (strpos($text, '<' . '?') !== false) {
ob_start();
eval('?' . '>' . $text);
$text = ob_get_contents();
ob_end_clean();
}
return $text;
wp_register_script( 'cycle', 'http://malsup.github.com/jquery.cycle.all.js');
wp_enqueue_script( 'cycle' );
@ginocremer
ginocremer / Page Slug in Body Classes WordPress
Created March 4, 2014 12:28
Page Slug in Body Classes WordPress
add_filter('body_class','body_class_section');
function body_class_section($classes) {
global $wpdb, $post;
if (is_page()) {
if ($post->post_parent) {
$parent = end(get_post_ancestors($current_page_id));
} else {
$parent = $post->ID;
}
$post_data = get_post($parent, ARRAY_A);