an>
19
|
+ the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
|
|
|
20
|
+ endif;
|
|
|
21
|
+
|
|
|
22
|
+ if ( 'post' === get_post_type() ) :
|
|
|
23
|
+ ?>
|
|
|
24
|
+ <div class="entry-meta">
|
|
|
25
|
+ <?php
|
|
|
26
|
+ whitesports_posted_on();
|
|
|
27
|
+ whitesports_posted_by();
|
|
|
28
|
+ ?>
|
|
|
29
|
+ </div><!-- .entry-meta -->
|
|
|
30
|
+ <?php endif; ?>
|
|
|
31
|
+ </header><!-- .entry-header -->
|
|
|
32
|
+ <div class="entry-content">
|
|
|
33
|
+ <?php
|
|
|
34
|
+ the_content(
|
|
|
35
|
+ sprintf(
|
|
|
36
|
+ wp_kses(
|
|
|
37
|
+ /* translators: %s: Name of current post. Only visible to screen readers */
|
|
|
38
|
+ __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'whitesports' ),
|
|
|
39
|
+ array(
|
|
|
40
|
+ 'span' => array(
|
|
|
41
|
+ 'class' => array(),
|
|
|
42
|
+ ),
|
|
|
43
|
+ )
|
|
|
44
|
+ ),
|
|
|
45
|
+ wp_kses_post( get_the_title() )
|
|
|
46
|
+ )
|
|
|
47
|
+ );
|
|
|
48
|
+
|
|
|
49
|
+ wp_link_pages(
|
|
|
50
|
+ array(
|
|
|
51
|
+ 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'whitesports' ),
|
|
|
52
|
+ 'after' => '</div>',
|
|
|
53
|
+ )
|
|
|
54
|
+ );
|
|
|
55
|
+ ?>
|
|
|
56
|
+ </div><!-- .entry-content -->
|
|
|
57
|
+
|
|
|
58
|
+</article><!-- #post-<?php the_ID(); ?> -->
|
|
|
59
|
+<hr>
|
|
|
60
|
+<p class='text-center h2'>
|
|
|
61
|
+บทความที่เกี่ยวข้อง</p><br>
|
|
|
62
|
+<div class='row'>
|
|
|
63
|
+<?php
|
|
|
64
|
+
|
|
|
65
|
+$related = get_posts( array( 'category__in' => wp_get_post_categories($post->ID), 'numberposts' => 4, 'post__not_in' => array($post->ID) ) );
|
|
|
66
|
+if( $related ) foreach( $related as $post ) {
|
|
|
67
|
+setup_postdata($post); ?>
|
|
|
68
|
+ <div class='col-md-3'>
|
|
|
69
|
+<?php
|
|
|
70
|
+the_post_thumbnail( 'medium' ); ?>
|
|
|
71
|
+ <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
|
|
72
|
+ </div>
|
|
|
73
|
+<?php }
|
|
|
74
|
+wp_reset_postdata(); ?>
|
|
|
75
|
+</div>
|
|
|
76
|
+<hr>
|
|
|
@@ -9,7 +9,7 @@
|
|
9
|
9
|
|
|
10
|
10
|
?>
|
|
11
|
11
|
|
|
12
|
|
-<article id="post-<?php the_ID(); ?>" class="col-md-3" style='margin-bottom:1.5em'>
|
|
|
12
|
+<article id="post-<?php the_ID(); ?>" class="col-md-4 article-item" style='margin-bottom:1.5em'>
|
|
13
|
13
|
<?php whitesports_post_thumbnail(); ?>
|
|
14
|
14
|
<?php if ( 'post' === get_post_type() ) : ?>
|
|
15
|
15
|
<div class="entry-meta">
|
|
|
@@ -19,5 +19,5 @@
|
|
19
|
19
|
</div><!-- .entry-meta -->
|
|
20
|
20
|
<?php endif; ?>
|
|
21
|
21
|
|
|
22
|
|
- <?php the_title( sprintf( '<strong><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></strong>' ); ?>
|
|
|
22
|
+ <?php the_title( sprintf( '<strong><a href="%s" rel="bookmark" class="text">', esc_url( get_permalink() ) ), '</a></strong>' ); ?>
|
|
23
|
23
|
</article><!-- #post-<?php the_ID(); ?> -->
|
|
|
@@ -62,7 +62,7 @@
|
|
62
|
62
|
<div class='row'>
|
|
63
|
63
|
<?php
|
|
64
|
64
|
|
|
65
|
|
-$related = get_posts( array( 'category__in' => wp_get_post_categories($post->ID), 'numberposts' => 5, 'post__not_in' => array($post->ID) ) );
|
|
|
65
|
+$related = get_posts( array( 'category__in' => wp_get_post_categories($post->ID), 'numberposts' => 4, 'post__not_in' => array($post->ID) ) );
|
|
66
|
66
|
if( $related ) foreach( $related as $post ) {
|
|
67
|
67
|
setup_postdata($post); ?>
|
|
68
|
68
|
<div class='col-md-3'>
|