Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. function whisper_entry_title2()
  2. {
  3. if ( !( $title = get_the_title() ) )
  4. return;
  5.  
  6. // Check on singular pages
  7. $is_single = is_singular() && !is_page_template( 'tpl/blog.php' ) && !is_page_template( 'tpl/blog-boxes.php' );
  8.  
  9. // Allow to config via global variable
  10. if ( isset( $whisper['is_single'] ) )
  11. $is_single = $whisper['is_single'];
  12.  
  13. $tag = $is_single ? 'h1' : 'h2';
  14. $title = sprintf( '<b class="black">%4$s</b>', $tag, get_permalink(), the_title_attribute( 'echo=0' ), $title );
  15. echo apply_filters( __FUNCTION__, $title );
  16.  
  17.  
  18. }
  19.  
  20. function whisper_content_limitoffer1( $num_words, $more = '...', $echo = true )
  21. {
  22. $content = get_the_content();
  23.  
  24. // Strip tags and shortcodes so the content truncation count is done correctly
  25. $content = strip_tags( strip_shortcodes( $content ), apply_filters( 'whisper_content_limit_allowed_tags', '<script>,<style>' ) );
  26.  
  27. // Remove inline styles / scripts
  28. $content = trim( preg_replace( '#<(s(cript|tyle)).*?</1>#si', '', $content ) );
  29.  
  30. // Truncate $content to $max_char
  31. $content = wp_trim_words( $content, $num_words );
  32.  
  33. if ( $more )
  34. {
  35. //$event_id = get_post_meta(get_the_ID(),'event_id', TRUE);
  36. //$link="http://example.com/wp/events-offers/";
  37. $output = sprintf(
  38. '<p class="event2-cf-oe">%s <a href="%s" class="more-link right o_6" title="%s">%s</a></p>',
  39. $content,
  40. get_permalink(),
  41. sprintf( __( 'Continue reading "%s"', 'whisper' ), the_title_attribute( 'echo=0' ) ),
  42. $more
  43. );
  44. }
  45. else
  46. {
  47. $output = sprintf( '<p class="event2-cf-oe">%s</p>', $content );
  48. }
  49.  
  50. // Still display post formats differently
  51. $output = whisper_post_formats_content( $output );
  52.  
  53. if ( $echo )
  54. echo $output;
  55. else
  56. return $output;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement