ByGanz (function.php)


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2.  
  3. require_once ( get_stylesheet_directory() . '/theme-options.php' );
  4.  
  5. // Remove the word "Protected" & "Private" from the Post's title
  6.  
  7. function the_title_trim($title) {
  8. $title = attribute_escape($title);
  9. $findthese = array(
  10. '#Protected:#',
  11. '#Private:#'
  12. );
  13. $replacewith = array(
  14. '', // What to replace "Protected:" with
  15. '' // What to replace "Private:" with
  16. );
  17. $title = preg_replace($findthese, $replacewith, $title);
  18. return $title;
  19. }
  20. add_filter('the_title', 'the_title_trim');
  21.  
  22. // Add RSS links to <head> section
  23. automatic_feed_links();
  24.  
  25. // Load jQuery
  26. if ( !is_admin() ) {
  27. wp_deregister_script('jquery');
  28. wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"), false);
  29. wp_enqueue_script('jquery');
  30. }
  31.  
  32. // Clean up the <head>
  33. function removeHeadLinks() {
  34. remove_action('wp_head', 'rsd_link');
  35. remove_action('wp_head', 'wlwmanifest_link');
  36. }
  37. add_action('init', 'removeHeadLinks');
  38. remove_action('wp_head', 'wp_generator');
  39.  
  40. if (function_exists('register_sidebar')) {
  41. register_sidebar(array(
  42. 'name' => 'Sidebar Widgets',
  43. 'id' => 'sidebar-widgets',
  44. 'description' => 'These are widgets for the sidebar.',
  45. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  46. 'after_widget' => '</div>',
  47. 'before_title' => '<h2>',
  48. 'after_title' => '</h2>'
  49. ));
  50. }
  51.  
  52. // Video home page
  53.  
  54. if (function_exists('register_sidebar')) {
  55. register_sidebar(array(
  56. 'name' => 'Homepage Video',
  57. 'id' => 'homepage-vid',
  58. 'description' => 'Just add the id of the video!',
  59. 'before_widget' => '',
  60. 'after_widget' => '',
  61. 'before_title' => '',
  62. 'after_title' => ''
  63. ));
  64. }
  65.  
  66. add_theme_support( 'post-thumbnails' );
  67. set_post_thumbnail_size( 194, 267, true ); // Normal post thumbnails // fan page thumbnail
  68. add_image_size('home-widget', 105, 151, true); // home page thumbnail
  69. add_image_size('Videos-List', 95, 115, true); // videos page thumbnail
  70. add_image_size( 'single-post-thumbnail', 200, 9999 ); // Permalink thumbnail size
  71.  
  72. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.