sagive

Split The_title using custom fields

Mar 15th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. <?php foreach( get_the_category() as $cat ) echo '<section class="middle ' . $cat->slug
  2. . '" >'; ?>
  3.  
  4. <?php if (have_posts()) : ?>
  5. <?php while (have_posts()) : the_post(); ?>
  6.  
  7. <article>
  8. <?php the_post_thumbnail(); ?>
  9. <!-- I swapped the below code with yours -->
  10.  
  11. <!--===STR====== THE TITLE ========-->
  12. <?php
  13. $sub_title = get_post_meta($post->ID,'subtitle',true);
  14. if($sub_title != '') {
  15. echo '<h1>'. the_title() .'<span>'. $sub_title .'</span></h1>';
  16. } else {
  17. echo '<h1>'. the_title() .'</h1>';
  18. }
  19. ?>
  20. <!--===END====== THE TITLE ========-->
  21.  
  22. <?php the_content(''); ?>
  23.  
  24. <div class="a-options">
  25. <a href="#new" class="comments scrollto">Comment</a>
  26.  
  27. <!-- share -->
  28. <div class="share-button">
  29. <div class="buttons">
  30. <div class="facebook">
  31.  
  32. <div class="fb-like" data-href="www.MyKettlesYard.co.uk" data-send="false" data-layout="button_count" data-width="95" data-show-faces="false" data-font="Arial"></div>
  33.  
  34. <span class="child-pseudo">Facebook</span>
  35. </div>
  36.  
  37. <div class="twitter">
  38.  
  39. <a href="https://twitter.com/share" class="twitter-share-button" data-url="www.MyKettlesYard.co.uk" data-text="Kettles Yard, Cambridge - www.MyKettlesYard.co.uk" data-count="horizontal">Tweet</a><script src="//platform.twitter.com/widgets.js"></script>
  40.  
  41. <span class="child-pseudo">Twitter</span>
  42. </div>
  43. </div>
  44.  
  45. <span class="pseudo-button">&#043; Share</span>
  46. </div> <!--! /share -->
  47.  
  48. </div><!--! /a-options -->
  49.  
  50. <?php comments_template(); ?>
  51.  
  52. </article>
  53.  
  54. <?php endwhile; ?>
  55.  
  56. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment