Advertisement
Guest User

Untitled

a guest
Apr 4th, 2012
1,444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. <?php
  2.  
  3. add_theme_support('post-thumbnails');
  4.  
  5. // Uncomment this if you want to test your localization, and make sure the test_localization function return your locale
  6.  
  7. // function test_localization( $locale ) {
  8.  
  9. // return "nl_NL";
  10.  
  11. // }
  12.  
  13. // add_filter('locale','test_localization');
  14.  
  15.  
  16.  
  17. load_theme_textdomain('studiopress', TEMPLATEPATH.'/languages/');
  18.  
  19.  
  20.  
  21. add_filter('comments_template', 'legacy_comments');
  22.  
  23.  
  24.  
  25. function legacy_comments($file) {
  26.  
  27.  
  28.  
  29. if(!function_exists('wp_list_comments')) : // WP 2.7-only check
  30.  
  31. $file = TEMPLATEPATH . '/legacy.comments.php';
  32.  
  33. endif;
  34.  
  35.  
  36.  
  37. return $file;
  38.  
  39. }
  40.  
  41.  
  42.  
  43. // Turn a category ID to a Name
  44.  
  45. function cat_id_to_name($id) {
  46.  
  47. foreach((array)(get_categories()) as $category) {
  48.  
  49. if ($id == $category->cat_ID) { return $category->cat_name; break; }
  50.  
  51. }
  52.  
  53. }
  54.  
  55.  
  56.  
  57. // include the theme options
  58.  
  59. include(TEMPLATEPATH."/tools/theme-options.php");
  60.  
  61.  
  62.  
  63. // include breadcrumb code
  64.  
  65. include(TEMPLATEPATH."/tools/breadcrumbs.php");
  66.  
  67.  
  68.  
  69. if ( function_exists('register_sidebars') )
  70.  
  71. register_sidebar(array('name'=>'Sidebar','before_title'=>'<h4>','after_title'=>'</h4>'));
  72.  
  73. register_sidebar(array('name'=>'Sidebar Home','before_title'=>'<h4>','after_title'=>'</h4>'));
  74.  
  75. register_sidebar(array('name'=>'468x60 Header Banner',));
  76.  
  77.  
  78.  
  79. function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
  80.  
  81. $content = get_the_content($more_link_text, $stripteaser, $more_file);
  82.  
  83. $content = apply_filters('the_content', $content);
  84.  
  85. $content = str_replace(']]>', ']]&gt;', $content);
  86.  
  87. $content = strip_tags($content);
  88.  
  89.  
  90.  
  91. if (strlen($_GET['p']) > 0) {
  92.  
  93. echo "<p>";
  94.  
  95. echo $content;
  96.  
  97. echo "&nbsp;<a rel='nofollow' href='";
  98.  
  99. the_permalink();
  100.  
  101. echo "'>".__('Read More', 'studiopress')." &rarr;</a>";
  102.  
  103. echo "</p>";
  104.  
  105. }
  106.  
  107. else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
  108.  
  109. $content = substr($content, 0, $espacio);
  110.  
  111. $content = $content;
  112.  
  113. echo "<p>";
  114.  
  115. echo $content;
  116.  
  117. echo "...";
  118.  
  119. echo "&nbsp;<a rel='nofollow' href='";
  120.  
  121. the_permalink();
  122.  
  123. echo "'>".$more_link_text."</a>";
  124.  
  125. echo "</p>";
  126.  
  127. }
  128.  
  129. else {
  130.  
  131. echo "<p>";
  132.  
  133. echo $content;
  134.  
  135. echo "&nbsp;<a rel='nofollow' href='";
  136.  
  137. the_permalink();
  138.  
  139. echo "'>".__("Read More", 'studiopress')." &rarr;</a>";
  140.  
  141. echo "</p>";
  142.  
  143. }
  144.  
  145. }
  146.  
  147.  
  148.  
  149.  
  150. // Remove WP Generator for security reasons
  151.  
  152. remove_action('wp_head', 'wp_generator');
  153.  
  154. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement