Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. // customize single post header content for dx5
  2. add_action( 'genesis_entry_header', 'dx5_do_post_header');
  3.  
  4. function dx5_do_post_header() {
  5. genesis_markup( array(
  6. 'html5' => '<header %s>',
  7. 'context' => 'dx5-post-heading',
  8. ) );
  9.  
  10. // find featured image for post
  11. $img = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "full")[0];
  12. $tag_list = get_the_tag_list( '<ul><li>','</li><li>','</li></ul>' );
  13.  
  14. // Added in content
  15. echo '<div class="dx5-post-heading clearfix">
  16. <div class="dx5-post-feature-image dx5-left"><img src="'. $img .'" /></div>
  17. <div class="dx5-post-title-info dx5-right">
  18. <h1>'. get_the_title() .'</h1>
  19. <h2>'. get_the_excerpt() .'</h2>
  20. <div class="tags">Tags: '. $tag_list .'</div>
  21. <div class="cookbook-recipe-times">'.dx5_all_recipe_prep_times() .'</div>
  22. </div>
  23. </div>';
  24.  
  25. genesis_structural_wrap( 'header' );
  26.  
  27. }
  28.  
  29. remove_action( 'cookbook_recipe_top', 'cookbook_recipe_time', 12 );
  30.  
  31. function dx5_all_recipe_prep_times( $recipe ) {
  32. $recipe_ids = cookbook_get_embedded_recipe_ids();
  33. if ( empty( $recipe_ids ) ) {
  34. return;
  35. }
  36. foreach ( $recipe_ids as $recipe_id ) {
  37. $recipe = cookbook_get_recipe( $recipe_id );
  38. if ( $recipe ) {
  39. echo cookbook_template_prep_time($recipe) . cookbook_template_cook_time($recipe) . cookbook_template_total_time($recipe);
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement