Guest User

content-image.php

a guest
May 24th, 2020
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. <?php
  2. /**
  3. * The template for displaying services image content
  4. *
  5. * @package Clean_Enterprise
  6. */
  7. ?>
  8.  
  9. <?php
  10. $quantity = get_theme_mod( 'clean_enterprise_services_number', 6 );
  11.  
  12. for ( $i = 1; $i <= $quantity; $i++ ) {
  13. $target = get_theme_mod( 'clean_enterprise_services_target_' . $i ) ? '_blank' : '_self';
  14.  
  15. $clean_enterprise_link = get_theme_mod( 'clean_enterprise_services_link_' . $i );
  16.  
  17. if ( function_exists( 'qtrans_convertURL' ) ) {
  18. $clean_enterprise_link = qtrans_convertURL( $clean_enterprise_link );
  19. }
  20.  
  21. echo '
  22. <article id="services-post-' . esc_attr( $i ) . '" class="hentry"> <div class="hentry-inner">';
  23.  
  24. $clean_enterprise_title = get_theme_mod( 'clean_enterprise_services_title_' . $i );
  25. $content = get_theme_mod( 'clean_enterprise_services_content_' . $i );
  26. $more_button = get_theme_mod( 'clean_enterprise_services_more_button_text_' . $i );
  27.  
  28. $image = get_theme_mod( 'clean_enterprise_services_image_' . $i );
  29.  
  30.  
  31. echo '<div class="post-thumbnail">';
  32.  
  33. if( $clean_enterprise_link ) {
  34. echo '<a href="' . esc_url( $clean_enterprise_link ) . '" target="' . esc_attr( $target ) . '">';
  35. }
  36.  
  37. if( $image ) {
  38. echo '<img src="' . esc_url( $image ) . '" class="wp-post-image" alt="' . esc_attr( $clean_enterprise_title ) . '" title="' . esc_attr( $clean_enterprise_title ) . '">';
  39. }
  40.  
  41. if( $clean_enterprise_link ) {
  42. echo '</a>';
  43. }
  44.  
  45. echo '</div>';
  46.  
  47. if ( $clean_enterprise_title || $content || $more_button) {
  48. echo '
  49. <div class="entry-container">';
  50.  
  51. if ( $clean_enterprise_title ) {
  52. echo '
  53. <header class="entry-header">
  54. <h2 class="entry-title">
  55. <a href="' . esc_url( $clean_enterprise_link ) . '" rel="bookmark" target="' . esc_attr( $target ) . '">' . wp_kses_post( $clean_enterprise_title ) . '</a>
  56. </h2>';
  57. echo '</header>';
  58. }
  59.  
  60. if ( $content || $more_button ) {
  61. if ( $more_button ) {
  62. $content .= '<span class="more-button">
  63. <a class="more-link" href="' . esc_url( $clean_enterprise_link ) . '" rel="bookmark" target="' . esc_attr( $target ) . '">' . esc_html( $more_button ) . '</a>
  64. </span>';
  65. }
  66.  
  67. echo '<div class="entry-summary">' . wp_kses_post( $content ) . '</div><!-- .entry-summary -->';
  68. }
  69.  
  70.  
  71.  
  72. echo '
  73. </div><!-- .entry-container -->';
  74. }
  75.  
  76. echo '
  77. </div>
  78. </article><!-- .services-post-' . esc_attr( $i ) . ' -->';
  79. } // End for().
Add Comment
Please, Sign In to add comment