Return to Snippet

Revision: 51381
at September 22, 2011 20:09 by kkw


Initial Code
<?php

	require_once ( get_stylesheet_directory() . '/theme-options.php' );
	
	// Remove the word "Protected" & "Private" from the Post's title
	
	function the_title_trim($title) {
	$title = attribute_escape($title);
	$findthese = array(
		'#Protected:#',
		'#Private:#'
	);
	$replacewith = array(
		'', // What to replace "Protected:" with
		'' // What to replace "Private:" with
	);
	$title = preg_replace($findthese, $replacewith, $title);
	return $title;
	}
	add_filter('the_title', 'the_title_trim');
	
	// Add RSS links to <head> section
	automatic_feed_links();
	
	// Load jQuery
	if ( !is_admin() ) {
	   wp_deregister_script('jquery');
	   wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"), false);
	   wp_enqueue_script('jquery');
	}
	
	// Clean up the <head>
	function removeHeadLinks() {
    	remove_action('wp_head', 'rsd_link');
    	remove_action('wp_head', 'wlwmanifest_link');
    }
    add_action('init', 'removeHeadLinks');
    remove_action('wp_head', 'wp_generator');
    
    if (function_exists('register_sidebar')) {
    	register_sidebar(array(
    		'name' => 'Sidebar Widgets',
    		'id'   => 'sidebar-widgets',
    		'description'   => 'These are widgets for the sidebar.',
    		'before_widget' => '<div id="%1$s" class="widget %2$s">',
    		'after_widget'  => '</div>',
    		'before_title'  => '<h2>',
    		'after_title'   => '</h2>'
    	));
    }

	// Video home page
	
	    if (function_exists('register_sidebar')) {
    	register_sidebar(array(
    		'name' => 'Homepage Video',
    		'id'   => 'homepage-vid',
    		'description'   => 'Just add the id of the video!',
    		'before_widget' => '',
    		'after_widget'  => '',
    		'before_title'  => '',
    		'after_title'   => ''
    	));
    }
	
	add_theme_support( 'post-thumbnails' );
	set_post_thumbnail_size( 194, 267, true ); // Normal post thumbnails // fan page thumbnail
	add_image_size('home-widget', 105, 151, true); // home page thumbnail
	add_image_size('Videos-List', 95, 115, true); // videos page thumbnail
	add_image_size( 'single-post-thumbnail', 200, 9999 ); // Permalink thumbnail size
	
?>

Initial URL


Initial Description


Initial Title
ByGanz (function.php)

Initial Tags


Initial Language
PHP