Guest User

custom-wcu.php

a guest
May 24th, 2020
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. <?php
  2. /**
  3. * The template for displaying why choose us image content
  4. *
  5. * @package Clean_Enterprise
  6. */
  7. ?>
  8.  
  9. <?php
  10. $quantity = get_theme_mod( 'clean_enterprise_why_choose_us_number', 4 );
  11.  
  12. for ( $i = 1; $i <= $quantity; $i++ ) {
  13. $target = get_theme_mod( 'clean_enterprise_why_choose_us_target_' . $i ) ? '_blank' : '_self';
  14.  
  15. $clean_enterprise_link = get_theme_mod( 'clean_enterprise_why_choose_us_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="why-choose-us-post-' . esc_attr( $i ) . '" class="hentry"> <div class="hentry-inner">';
  23.  
  24. $clean_enterprise_title = get_theme_mod( 'clean_enterprise_why_choose_us_title_' . $i );
  25. $content = get_theme_mod( 'clean_enterprise_why_choose_us_content_' . $i );
  26. $more_button = get_theme_mod( 'clean_enterprise_why_choose_us_more_button_text_' . $i );
  27.  
  28. $image = get_theme_mod( 'clean_enterprise_why_choose_us_image_' . $i ) ? get_theme_mod( 'clean_enterprise_why_choose_us_image_' . $i ) : '';
  29.  
  30. echo '
  31. <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.  
  39. echo '<img src="' . esc_url( $image ) . '" class="wp-post-image" alt="' . esc_attr( $clean_enterprise_title ) . '" title="' . esc_attr( $clean_enterprise_title ) . '">';
  40. }
  41.  
  42. if( $clean_enterprise_link ) {
  43. echo '</a>';
  44. }
  45.  
  46.  
  47. echo '</div>';
  48.  
  49. if ( $clean_enterprise_title || $content || $more_button) {
  50. echo '
  51. <div class="entry-container">';
  52.  
  53. if ( $clean_enterprise_title ) {
  54. echo '
  55. <header class="entry-header">
  56. <h2 class="entry-title">
  57. <a href="' . esc_url( $clean_enterprise_link ) . '" rel="bookmark" target="' . esc_attr( $target ) . '">' . wp_kses_post( $clean_enterprise_title ) . '</a>
  58. </h2>';
  59. echo '</header>';
  60. }
  61.  
  62. if ( $content || $more_button ) {
  63. if ( $more_button ) {
  64. $content .= '<span class="more-button">
  65. <a class="more-link" href="' . esc_url( $clean_enterprise_link ) . '" rel="bookmark" target="' . esc_attr( $target ) . '">' . esc_html( $more_button ) . '</a>
  66. </span>';
  67. }
  68.  
  69. echo '<div class="entry-summary">' . wp_kses_post( $content ) . '</div><!-- .entry-summary -->';
  70. }
  71.  
  72.  
  73.  
  74. echo '
  75. </div><!-- .entry-container -->';
  76. }
  77.  
  78. echo '
  79. </div>
  80. </article><!-- .why-choose-us-post-' . esc_attr( $i ) . ' -->';
  81. } // End for().
Add Comment
Please, Sign In to add comment