cmoreira

replace titles in ttshowcase

Oct 1st, 2014
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. // Code to change title (anonimous entries)
  2. // To change for each entry title
  3. add_filter( 'the_title', 'ttshowcase_modified_post_title');
  4.  
  5. function ttshowcase_modified_post_title ($title, $id = null) {
  6.  
  7. if('ttshowcase' == get_post_type($id) && !is_admin() && in_the_loop()) {
  8. $title = 'Hospital Client';
  9. }
  10.  
  11. return $title;
  12. }
  13.  
  14. // To change in the page title
  15. add_filter( 'wp_title', 'ttshowcase_modified_page_title');
  16.  
  17. function ttshowcase_modified_page_title ($title, $id = null) {
  18.  
  19. if('ttshowcase' == get_post_type($id)) {
  20. $title = 'Hospital Client ';
  21. }
  22.  
  23. return $title;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment