Advertisement
acegiak

content aside mf2 markup

Jun 5th, 2014
544
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.11 KB | None | 0 0
  1. <article <?php sempress_post_id(); ?> <?php post_class(); ?><?php sempress_semantics("post"); ?>>
  2.   <?php if ( is_search() ) : // Only display Excerpts for search pages ?>
  3.   <div class="entry-summary p-summary entry-title p-name" itemprop="name description">
  4.     <?php the_excerpt(); ?>
  5.   </div><!-- .entry-summary -->
  6.   <?php else : ?>
  7. <?php if(in_array("contextTarget",get_post_custom_keys(get_the_ID()))){
  8.  $customfields = get_post_custom(get_the_ID());
  9.     $verbs = array();
  10. echo '<div class="';
  11.  
  12. if(array_key_exists("contextLike",$customfields) && $customfields['contextLike'][0] == true){
  13.     echo "p-like p-like-of ";
  14.     $verbs[] = "liked";
  15. }
  16.  
  17.  
  18.     if(strlen(get_the_content()) < 1){
  19.         if(array_key_exists("context",$customfields) && strlen(implode($customfields["context"],"")) > 0){
  20.             $verbs[] = "reposted";
  21.             echo "p-repost p-repost-of";
  22.         }
  23.     }else{
  24.         $verbs[] = "commented";
  25.         echo "p-in-reply-to";
  26.         if(array_key_exists("context",$customfields) && strlen(implode($customfields["context"],"")) > 0){
  27.             echo  " h-cite";
  28.             $verbs[] = "reposted";
  29.         }
  30.     }
  31. echo '">';
  32. $contextbox = "";
  33. if(array_key_exists("context",$customfields) && strlen(implode($customfields["context"],"")) > 0){
  34.     $contextbox = '<blockquote class="p-content"><p>'.$contextbox . implode("</p><p>",$customfields["context"]).'</p></blockquote>';
  35. }
  36. if(array_key_exists("contextTitle",$customfields)){
  37.     $contextbox = '<p>'.$contextbox.' '.implode($verbs," and ").' <a class="u-url" href="'.$customfields['contextTarget'][0].'">@'.$customfields['contextTitle'][0].'</a></p>';
  38. }
  39.  
  40. echo $contextbox.'</div>'; }?>
  41.   <div class="entry-content e-content p-summary" itemprop="name headline description articleBody">
  42.     <?php sempress_the_post_thumbnail('<p>', '</p>'); ?>
  43.     <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'sempress' ) ); ?>
  44.     <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'sempress' ), 'after' => '</div>' ) ); ?>
  45.   </div><!-- .entry-content -->
  46.   <?php endif; ?>
  47.  
  48.   <?php get_template_part( 'entry', 'footer' ); ?>
  49. </article><!-- #post-<?php the_ID(); ?> -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement