isotope1.php
3 years ago
layout1.php
3 years ago
layout12.php
3 years ago
layout2.php
3 years ago
layout3.php
3 years ago
layout5.php
3 years ago
layout6.php
3 years ago
layout7.php
3 years ago
layout3.php
119 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Layout Template - 3 |
| 4 | * |
| 5 | * @package RT_TPG |
| 6 | */ |
| 7 | |
| 8 | use RT\ThePostGrid\Helpers\Fns; |
| 9 | |
| 10 | // Do not allow directly accessing this file. |
| 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 12 | exit( 'This script cannot be accessed directly.' ); |
| 13 | } |
| 14 | |
| 15 | $html = $htmlDetail = $catHtml = $metaHtml = null; |
| 16 | |
| 17 | if ( in_array( 'categories', $items ) && $categories ) { |
| 18 | $catHtml .= "<span class='categories-links'>"; |
| 19 | |
| 20 | if ( $catIcon ) { |
| 21 | $catHtml .= "<i class='".Fns::change_icon( 'fas fa-folder-open', 'flaticon-folder' )."'></i>"; |
| 22 | } |
| 23 | |
| 24 | $catHtml .= "{$categories}</span>"; |
| 25 | } |
| 26 | |
| 27 | if ( in_array( 'post_date', $items ) && $date ) { |
| 28 | $metaHtml .= "<span class='date-meta'>"; |
| 29 | |
| 30 | if ( $metaIcon ) { |
| 31 | $metaHtml .= "<i class='" . Fns::change_icon( 'far fa-calendar-alt', 'flaticon-calendar' ) . "'></i>"; |
| 32 | } |
| 33 | |
| 34 | $metaHtml .= "{$date}</span>"; |
| 35 | } |
| 36 | |
| 37 | if ( in_array( 'author', $items ) ) { |
| 38 | $metaHtml .= "<span class='author'>"; |
| 39 | |
| 40 | if ( $metaIcon ) { |
| 41 | $metaHtml .= "<i class='" . Fns::change_icon( 'fa fa-user', 'flaticon-user' ) . "'></i>"; |
| 42 | } |
| 43 | |
| 44 | $metaHtml .= "{$author}</span>"; |
| 45 | } |
| 46 | |
| 47 | $metaHtml .= $catHtml; |
| 48 | |
| 49 | if ( in_array( 'tags', $items ) && $tags ) { |
| 50 | $metaHtml .= "<span class='post-tags-links'>"; |
| 51 | |
| 52 | if ( $metaIcon ) { |
| 53 | $metaHtml .= "<i class='" . Fns::change_icon( 'fa fa-tags', 'flaticon-tag' ) . "'></i>"; |
| 54 | } |
| 55 | |
| 56 | $metaHtml .= "{$tags}</span>"; |
| 57 | } |
| 58 | |
| 59 | if ( in_array( 'comment_count', $items ) ) { |
| 60 | $metaHtml .= '<span class="comment-count">'; |
| 61 | |
| 62 | if ( $metaIcon ) { |
| 63 | $metaHtml .= "<i class='". Fns::change_icon( 'fas fa-comments', 'flaticon-chat' ) . "'></i>"; |
| 64 | } |
| 65 | |
| 66 | $metaHtml .= $comment . '</span>'; |
| 67 | } |
| 68 | |
| 69 | $html .= sprintf( '<div class="%s" data-id="%d">', esc_attr( implode( ' ', [ $grid, $class ] ) ), $pID ); |
| 70 | $html .= '<div class="rt-holder">'; |
| 71 | $html .= '<div class="rt-row">'; |
| 72 | |
| 73 | if ( $imgSrc ) { |
| 74 | $html .= "<div class='{$image_area}'>"; |
| 75 | $html .= '<div class="rt-img-holder">'; |
| 76 | $html .= "<a data-id='{$pID}' class='{$anchorClass} rounded' href='{$pLink}'{$link_target}>{$imgSrc}</a>"; |
| 77 | $html .= '</div>'; |
| 78 | $html .= '</div>'; |
| 79 | } else { |
| 80 | $content_area = 'rt-col-xs-12'; |
| 81 | } |
| 82 | |
| 83 | $html .= "<div class='{$content_area}'>"; |
| 84 | |
| 85 | if ( ! empty( $metaHtml ) && $metaPosition == 'above_title' ) { |
| 86 | $htmlDetail .= "<div class='post-meta-user {$metaSeparator}'>$metaHtml</div>"; |
| 87 | } |
| 88 | |
| 89 | if ( in_array( 'title', $items ) ) { |
| 90 | $htmlDetail .= sprintf( '<%1$s class="entry-title"><a data-id="%2$s" class="%3$s" href="%4$s"%5$s>%6$s</a></%1$s>', $title_tag, $pID, $anchorClass, $pLink, $link_target, $title ); |
| 91 | } |
| 92 | |
| 93 | if ( ! empty( $metaHtml ) && ( empty( $metaPosition ) || $metaPosition == 'above_excerpt' ) ) { |
| 94 | $htmlDetail .= "<div class='post-meta-user {$metaSeparator}'>$metaHtml</div>"; |
| 95 | } |
| 96 | |
| 97 | if ( in_array( 'excerpt', $items ) ) { |
| 98 | $htmlDetail .= "<div class='post-content'><p>{$excerpt}</p></div>"; |
| 99 | } |
| 100 | |
| 101 | if ( ! empty( $metaHtml ) && $metaPosition == 'below_excerpt' ) { |
| 102 | $htmlDetail .= "<div class='post-meta-user {$metaSeparator}'>$metaHtml</div>"; |
| 103 | } |
| 104 | |
| 105 | if ( in_array( 'read_more', $items ) ) { |
| 106 | $htmlDetail .= "<span class='read-more {$btn_alignment_class}'><a data-id='{$pID}' class='{$anchorClass}' href='{$pLink}'{$link_target}>{$read_more_text}</a></span>"; |
| 107 | } |
| 108 | |
| 109 | if ( ! empty( $htmlDetail ) ) { |
| 110 | $html .= "<div class='rt-detail'>$htmlDetail</div>"; |
| 111 | } |
| 112 | |
| 113 | $html .= '</div>'; |
| 114 | $html .= '</div>'; |
| 115 | $html .= '</div>'; |
| 116 | $html .= '</div>'; |
| 117 | |
| 118 | Fns::print_html( $html ); |
| 119 |