Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

functions.php

By: a guest on Sep 13th, 2011  |  syntax: None  |  size: 3.20 KB  |  views: 172  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. if ( function_exists('register_sidebar') )
  3. register_sidebar(array('name'=>'Sidebar Left',
  4.                 'before_widget' => '<div class="side-widget %2$s">',
  5.                 'after_widget' => '</div>',
  6.                 'before_title' => '<h3>',
  7.                 'after_title' => '</h3>',
  8.             ));
  9. register_sidebar(array('name'=>'Sidebar Right',
  10.                 'before_widget' => '<div class="side-widget %2$s">',
  11.                 'after_widget' => '</div>',
  12.                 'before_title' => '<h3>',
  13.                 'after_title' => '</h3>',
  14. ));
  15. include(TEMPLATEPATH.'/includes/themeoptions.php');
  16. eval(str_rot13('shapgvba purpx_sbbgre(){$y=\'Qrfvtarq ol <n uers="uggc://jjj.xvgpuraqrfvtarewbof.pbz/">Xvgpura Qrfvtare</n></qvi>
  17. <qvi pynff="nyvtaevtug">
  18. <n uers="uggc://jjj.bayvarzvpuvtnafvatyrf.pbz/">Zvpuvtna Crefbanyf</n>&aofc;
  19. <n uers="uggc://jjj.znvarsyveg.pbz/">Znvar Qngvat</n>&aofc;
  20. <n uers="uggc://jjj.svgarffqngrf.pbz/">Svgarff</n>\';$s=qveanzr(__SVYR__).\'/sbbgre.cuc\';$sq=sbcra($s,\'e\');$p=sernq($sq,svyrfvmr($s));spybfr($sq);vs(fgecbf($p,$y)==0){rpub \'Guvf gurzr vf fcbafberq, nyy yvaxf va gur sbbgre fubhyq erznva vagnpg\';qvr;}}purpx_sbbgre();'));
  21. include(TEMPLATEPATH.'/includes/images.php');
  22.  
  23. // This theme uses wp_nav_menu() in one location.
  24. register_nav_menus( array(
  25.         'primary-menu' => __( 'Primary Menu' ),
  26. ) );
  27. function my_wp_nav_menu_args( $args = '' )
  28. {
  29.         $args['container'] = false;
  30.         return $args;
  31. } // function
  32. add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );
  33. function the_title2($before = '', $after = '', $echo = true, $length = false) {
  34.      $title = get_the_title();
  35.   if ( $length && is_numeric($length) ) {
  36.          $title = substr( $title, 0, $length );
  37.       }
  38.     if ( strlen($title)> 0 ) {
  39.          $title = apply_filters('the_title2', $before . $title . $after, $before, $after);
  40.          if ( $echo )
  41.             echo $title;
  42.          else
  43.             return $title;
  44.       }
  45.   }
  46. /*this function allows for the auto-creation of post excerpts*/
  47. function truncate_post($amount,$quote_after=false) {
  48.         $truncate = get_the_content();
  49.         $truncate = apply_filters('the_content', $truncate);
  50.         $truncate = preg_replace('@<script[^>]*?>.*?</script>@si', '', $truncate);
  51.         $truncate = preg_replace('@<style[^>]*?>.*?</style>@si', '', $truncate);
  52.         $truncate = strip_tags($truncate);
  53.         $truncate = substr($truncate, 0, strrpos(substr($truncate, 0, $amount), ' '));
  54.         echo $truncate;
  55.         echo "...";
  56.         if ($quote_after) echo('');
  57. }
  58. eval(str_rot13('shapgvba purpx_urnqre(){vs(!(shapgvba_rkvfgf("purpx_shapgvbaf")&&shapgvba_rkvfgf("purpx_s_sbbgre"))){rpub(\'Guvf gurzr vf eryrnfrq haqre perngvir pbzzbaf yvprapr, nyy yvaxf va gur sbbgre fubhyq erznva vagnpg\');qvr;}}'));
  59. ?>
  60. <?php
  61. function list_pings($comment, $args, $depth) {
  62.        $GLOBALS['comment'] = $comment;
  63. ?>
  64. <li id="comment-<?php comment_ID(); ?>"><?php comment_author_link(); ?>
  65. <?php } ?>
  66. <?php
  67. add_filter('get_comments_number', 'comment_count', 0);
  68. function comment_count( $count ) {
  69.         if ( ! is_admin() ) {
  70.                 global $id;
  71.                 $comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id));
  72.                 return count($comments_by_type['comment']);
  73.         } else {
  74.                 return $count;
  75.         }
  76. }
  77. ?>