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
layout1.php
132 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Layout Template - 1 |
| 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 = $metaHtml = $iTitle = $catHtml = $postMetaTop = $postMetaMid = null; |
| 16 | |
| 17 | if ( in_array( 'categories', $items ) && $categories ) { |
| 18 | $catHtml .= "<span class='categories-links'>"; |
| 19 | |
| 20 | if ( $catIcon ) { |
| 21 | $catHtml .= "<i class='fas fa-folder-open'></i>"; |
| 22 | } |
| 23 | |
| 24 | $catHtml .= "{$categories}</span>"; |
| 25 | } |
| 26 | |
| 27 | if ( in_array( 'author', $items ) ) { |
| 28 | $postMetaTop .= "<span class='author'>"; |
| 29 | |
| 30 | if ( $metaIcon ) { |
| 31 | $postMetaTop .= "<i class='fa fa-user'></i>"; |
| 32 | } |
| 33 | |
| 34 | $postMetaTop .= "{$author}</span>"; |
| 35 | } |
| 36 | |
| 37 | if ( in_array( 'post_date', $items ) && $date ) { |
| 38 | $postMetaTop .= "<span class='date'>"; |
| 39 | |
| 40 | if ( $metaIcon ) { |
| 41 | $postMetaTop .= "<i class='far fa-calendar-alt'></i>"; |
| 42 | } |
| 43 | |
| 44 | $postMetaTop .= "{$date}</span>"; |
| 45 | } |
| 46 | |
| 47 | $postMetaTop .= $catHtml; |
| 48 | |
| 49 | if ( in_array( 'tags', $items ) && $tags ) { |
| 50 | $postMetaTop .= "<span class='post-tags-links'>"; |
| 51 | |
| 52 | if ( $metaIcon ) { |
| 53 | $postMetaTop .= "<i class='fa fa-tags'></i>"; |
| 54 | } |
| 55 | |
| 56 | $postMetaTop .= "{$tags}</span>"; |
| 57 | } |
| 58 | |
| 59 | if ( in_array( 'comment_count', $items ) ) { |
| 60 | $postMetaTop .= '<span class="comment-count">'; |
| 61 | |
| 62 | if ( $metaIcon ) { |
| 63 | $postMetaTop .= '<i class="fas fa-comments"></i>'; |
| 64 | } |
| 65 | |
| 66 | $postMetaTop .= $comment . '</span>'; |
| 67 | } |
| 68 | |
| 69 | if ( in_array( 'title', $items ) ) { |
| 70 | $iTitle = 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 ); |
| 71 | } |
| 72 | |
| 73 | $html .= sprintf( '<div class="%s" data-id="%d">', esc_attr( implode( ' ', [ $grid, $class ] ) ), $pID ); |
| 74 | $html .= '<div class="rt-holder">'; |
| 75 | |
| 76 | if ( $tpg_title_position == 'above' ) { |
| 77 | if ( ! empty( $postMetaTop ) && $metaPosition == 'above_title' ) { |
| 78 | $html .= "<div class='post-meta-user {$metaPosition} {$metaSeparator}'>{$postMetaTop}</div>"; |
| 79 | } |
| 80 | |
| 81 | $html .= sprintf( '<div class="rt-detail rt-with-title">%s</div>', $iTitle ); |
| 82 | } |
| 83 | |
| 84 | if ( $imgSrc ) { |
| 85 | $html .= '<div class="rt-img-holder">'; |
| 86 | $html .= sprintf( '<a data-id="%s" class="%s" href="%s"%s>%s</a>', $pID, $anchorClass, $pLink, $link_target, $imgSrc ); |
| 87 | $html .= '</div>'; |
| 88 | } |
| 89 | |
| 90 | if ( ! empty( $postMetaTop ) && $metaPosition == 'above_title' && $tpg_title_position != 'above' ) { |
| 91 | $htmlDetail .= "<div class='post-meta-user {$metaPosition} {$metaSeparator}'>{$postMetaTop}</div>"; |
| 92 | } |
| 93 | |
| 94 | if ( $tpg_title_position != 'above' ) { |
| 95 | $htmlDetail .= $iTitle; |
| 96 | } |
| 97 | |
| 98 | if ( ! empty( $postMetaTop ) && ( empty( $metaPosition ) || $metaPosition == 'above_excerpt' ) ) { |
| 99 | $htmlDetail .= "<div class='post-meta-user {$metaPosition} {$metaSeparator}'>{$postMetaTop}</div>"; |
| 100 | } |
| 101 | |
| 102 | if ( ! empty( $postMetaMid ) ) { |
| 103 | $htmlDetail .= "<div class='post-meta-tags'>{$postMetaMid}</div>"; |
| 104 | } |
| 105 | |
| 106 | if ( in_array( 'excerpt', $items ) ) { |
| 107 | $htmlDetail .= "<div class='tpg-excerpt'>{$excerpt}</div>"; |
| 108 | } |
| 109 | |
| 110 | if ( ! empty( $postMetaTop ) && $metaPosition == 'below_excerpt' ) { |
| 111 | $htmlDetail .= "<div class='post-meta-user {$metaPosition} {$metaSeparator}'>{$postMetaTop}</div>"; |
| 112 | } |
| 113 | |
| 114 | $postMetaBottom = null; |
| 115 | |
| 116 | if ( in_array( 'read_more', $items ) ) { |
| 117 | $postMetaBottom .= "<span class='read-more'><a data-id='{$pID}' class='{$anchorClass}' href='{$pLink}'{$link_target}>{$read_more_text}</a></span>"; |
| 118 | } |
| 119 | |
| 120 | if ( ! empty( $postMetaBottom ) ) { |
| 121 | $htmlDetail .= "<div class='post-meta {$btn_alignment_class}'>$postMetaBottom</div>"; |
| 122 | } |
| 123 | |
| 124 | if ( ! empty( $htmlDetail ) ) { |
| 125 | $html .= "<div class='rt-detail'>$htmlDetail</div>"; |
| 126 | } |
| 127 | |
| 128 | $html .= '</div>'; |
| 129 | $html .= '</div>'; |
| 130 | |
| 131 | Fns::print_html( $html ); |
| 132 |