1. <?php
  2. /**
  3. * The default template for displaying content
  4. * Used for single posts.
  5. */
  6. ?>
  7. <?php $grid = ot_get_option( 'grid_option', 'col-sm-' ); ?>
  8. <a id="top"></a>
  9. <div class="container content-single">
  10. <div class="row">
  11. <div class="<?php echo sanitize_html_class( $grid );?>12">
  12. <div id="post-<?php the_ID();?>" <?php post_class( 'link-container' );?>>
  13. <div class="row">
  14. <div class="<?php echo sanitize_html_class( $grid );?>12">
  15. <div class="link-header nocenter">
  16. <h1 class="post-header"><?php printf( "%s", $site_icon );?> <?php the_title();?></h1>
  17. <div class="link-header-back">
  18. <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span> <?php _e( 'Back To Home', 'test123' ); ?></a>
  19. </div>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="row">
  24. <div class="<?php echo sanitize_html_class( $grid );?>12">
  25. <div class="link-content">
  26. <div class="crp_related crp-rounded-thumbs"><ul>
  27. <?
  28. $args = array(
  29. 'orderby' => 'id',
  30. 'hide_empty'=> 0,
  31. );
  32. $categories = get_categories($args);
  33. $size = 'full';
  34. foreach($categories as $category) {
  35. $image = get_field('image', $category->term_id);
  36. var_dump($image);
  37. echo '
  38. <li>
  39. <a href="' . get_category_link($category->term_id) . '"><img src="'.$image['url'].'" alt="' . $category->name . '" /></a>
  40. <span class="crp_title" style="bottom:4px;">', (
  41. strlen($title= the_title('', '', false)) > 48 ?
  42. substr($title, 0, 48) :
  43. $category->name
  44. ), '</span>
  45. </li>';
  46. }
  47. echo '</ul>';
  48. echo '<div class="crp_clear"></div></div>';
  49. ?>
  50. <?php wp_reset_postdata(); ?>
  51. </div> <!-- end link-content -->
  52. </div>
  53. </div>
  54. <div class="row">
  55. <div class="<?php echo sanitize_html_class( $grid );?>12">
  56. <div class="comments-container">
  57. <?php comments_template( '', true ); ?>
  58. </div>
  59. </div>
  60. </div>
  61. </div> <!-- end link-container -->
  62. </div>
  63. </div>
  64. </div>