Advertisement
srikat

Untitled

May 18th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.20 KB | None | 0 0
  1. if ( function_exists( 'add_image_size' ) ) {
  2.     add_image_size( 'listing-page-thumb', 822, 300, true );
  3.     add_image_size( 'sidebar-thumb', 94, 62, true );
  4. }
  5.  
  6. function clickable_ellipsis($content){
  7.  
  8.     $searchfor = '/\[(...)\]/';
  9.     $replacewith = '[<a href="'.get_permalink().'">$1</a>]';
  10.  
  11.     $content = preg_replace($searchfor, $replacewith, $content, 1);
  12.     return $content;
  13.  
  14. }
  15.  
  16. add_filter('the_excerpt', 'clickable_ellipsis');
  17.  
  18.  
  19.  
  20.  
  21.  
  22. // =========================================
  23. // = My Changes Below =
  24. // =========================================
  25.  
  26.  
  27. add_action('wp_enqueue_scripts', 'add_my_code');
  28.  
  29. function add_my_code() {
  30.  
  31.     add_action( 'print_footer_scripts', 'my_footer_script' );
  32. }
  33.  
  34. // Add jQuery to footer
  35.  
  36. function my_footer_script() { ?>
  37.  
  38.  
  39.     <!-- only on Posts page, archives and search listing pages -->
  40.     <?php if(is_home() || is_archive() || is_search()) { ?>
  41.     <script type="text/javascript">
  42.         jQuery(function($) {
  43.  
  44.             $("img.listing-thumb").hover(
  45.                     function () {
  46.                         $(this).stop().fadeTo("fast", 0.7);
  47.                     },
  48.                     function () {
  49.                         $(this).stop().fadeTo("fast", 1);
  50.                     }
  51.                 );
  52.         });
  53.     </script>
  54.     <?php }
  55.  
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement