This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Pulling in Pages

By: a guest on Jun 21st, 2011  |  syntax: PHP  |  size: 0.92 KB  |  views: 39  |  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.         // the code below will never change.
  3.         function get_my_content($page) {
  4.             $my_id = $page;
  5.             $post_id = get_post($my_id, ARRAY_A);
  6.             $title = $post_id['post_title'];
  7.             $content = $post_id['post_content'];
  8.  
  9.             return $content;
  10.         }
  11. ?>
  12.  
  13. <div class='showreel-title' id='showreel-title-excerpts'>Showreel Excerpts</div>
  14. <div class='showreel'>
  15. <?php
  16.         $page = get_page_by_path('Showreels/Excerpts');
  17.         echo get_my_content($page);
  18. ?>
  19. </div>
  20.  
  21. <div class='showreel-title' id='showreel-title-the-ruth-rendell-mysteries'>The Ruth Rendell Mysteries</div>
  22. <div class='showreel'>
  23. <?php
  24.         $page = get_page_by_path('Showreels/The Ruth Rendell Mysteries');
  25.         echo get_my_content($page);
  26. ?>
  27. </div>
  28.  
  29. <div class='showreel-title' id='showreel-title-dalziel-and-pascoe'>Dalziel and Pascoe</div>
  30. <div class='showreel'>
  31. <?php
  32.         $page = get_page_by_path('Showreels/Dalziel and Pascoe');
  33.         echo get_my_content($page);
  34. ?>
  35. </div>
clone this paste RAW Paste Data