"language-php">+ 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>

+ 2 - 2
app/wp-content/themes/whitesports/template-parts/content-search.php

@@ -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(); ?> -->

+ 1 - 1
app/wp-content/themes/whitesports/template-parts/content.php

@@ -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'>

BIN
app/wp-content/uploads/2021/11/00-100x100.jpg


BIN
app/wp-content/uploads/2021/11/00-150x150.jpg


BIN
app/wp-content/uploads/2021/11/00-300x169.jpg


BIN
app/wp-content/uploads/2021/11/00-300x300.jpg


BIN
app/wp-content/uploads/2021/11/00-600x338.jpg


BIN
app/wp-content/uploads/2021/11/00-60x60.jpg


BIN
app/wp-content/uploads/2021/11/00-768x432.jpg


BIN
app/wp-content/uploads/2021/11/00.jpg


BIN
app/wp-content/uploads/2021/11/0000-100x100.jpg


BIN
app/wp-content/uploads/2021/11/0000-150x150.jpg


BIN
app/wp-content/uploads/2021/11/0000-300x169.jpg


BIN
app/wp-content/uploads/2021/11/0000-300x300.jpg


BIN
app/wp-content/uploads/2021/11/0000-600x338.jpg


BIN
app/wp-content/uploads/2021/11/0000-60x60.jpg


BIN
app/wp-content/uploads/2021/11/0000-768x432.jpg


BIN
app/wp-content/uploads/2021/11/0000.jpg


BIN
app/wp-content/uploads/2021/11/1-1-100x100.jpg


BIN
app/wp-content/uploads/2021/11/1-1-150x150.jpg


BIN
app/wp-content/uploads/2021/11/1-1-300x169.jpg


BIN
app/wp-content/uploads/2021/11/1-1-300x300.jpg


BIN
app/wp-content/uploads/2021/11/1-1-600x338.jpg


BIN
app/wp-content/uploads/2021/11/1-1-60x60.jpg


BIN
app/wp-content/uploads/2021/11/1-1-768x432.jpg


BIN
app/wp-content/uploads/2021/11/1-1.jpg


BIN
app/wp-content/uploads/2021/11/111-100x100.jpg


BIN
app/wp-content/uploads/2021/11/111-150x150.jpg


BIN
app/wp-content/uploads/2021/11/111-300x169.jpg


BIN
app/wp-content/uploads/2021/11/111-300x300.jpg


BIN
app/wp-content/uploads/2021/11/111-600x338.jpg


BIN
app/wp-content/uploads/2021/11/111-60x60.jpg


BIN
app/wp-content/uploads/2021/11/111-768x432.jpg


BIN
app/wp-content/uploads/2021/11/111.jpg


BIN
app/wp-content/uploads/2021/11/12-100x100.jpg


BIN
app/wp-content/uploads/2021/11/12-150x150.jpg


BIN
app/wp-content/uploads/2021/11/12-300x169.jpg


BIN
app/wp-content/uploads/2021/11/12-300x300.jpg


BIN
app/wp-content/uploads/2021/11/12-600x338.jpg


BIN
app/wp-content/uploads/2021/11/12-60x60.jpg


BIN
app/wp-content/uploads/2021/11/12-768x432.jpg


BIN
app/wp-content/uploads/2021/11/12.jpg


BIN
app/wp-content/uploads/2021/11/1212-100x100.jpg


BIN
app/wp-content/uploads/2021/11/1212-150x150.jpg


BIN
app/wp-content/uploads/2021/11/1212-300x169.jpg


BIN
app/wp-content/uploads/2021/11/1212-300x300.jpg


BIN
app/wp-content/uploads/2021/11/1212-600x338.jpg


BIN
app/wp-content/uploads/2021/11/1212-60x60.jpg


BIN
app/wp-content/uploads/2021/11/1212-768x432.jpg


BIN
app/wp-content/uploads/2021/11/1212.jpg


BIN
app/wp-content/uploads/2021/11/14-100x100.jpg


BIN
app/wp-content/uploads/2021/11/14-150x150.jpg


BIN
app/wp-content/uploads/2021/11/14-300x169.jpg


BIN
app/wp-content/uploads/2021/11/14-300x300.jpg


BIN
app/wp-content/uploads/2021/11/14-600x338.jpg


BIN
app/wp-content/uploads/2021/11/14-60x60.jpg


BIN
app/wp-content/uploads/2021/11/14-768x432.jpg


BIN
app/wp-content/uploads/2021/11/14.jpg


BIN
app/wp-content/uploads/2021/11/2-1-100x100.jpg


BIN
app/wp-content/uploads/2021/11/2-1-150x150.jpg


BIN
app/wp-content/uploads/2021/11/2-1-300x169.jpg


BIN
app/wp-content/uploads/2021/11/2-1-300x300.jpg


BIN
app/wp-content/uploads/2021/11/2-1-600x338.jpg


BIN
app/wp-content/uploads/2021/11/2-1-60x60.jpg


BIN
app/wp-content/uploads/2021/11/2-1-768x432.jpg


BIN
app/wp-content/uploads/2021/11/2-1.jpg


BIN
app/wp-content/uploads/2021/11/3-1-100x100.jpg


BIN
app/wp-content/uploads/2021/11/3-1-150x150.jpg


BIN
app/wp-content/uploads/2021/11/3-1-300x169.jpg


BIN
app/wp-content/uploads/2021/11/3-1-300x300.jpg


BIN
app/wp-content/uploads/2021/11/3-1-600x338.jpg


BIN
app/wp-content/uploads/2021/11/3-1-60x60.jpg


BIN
app/wp-content/uploads/2021/11/3-1-768x432.jpg


BIN
app/wp-content/uploads/2021/11/3-1.jpg


BIN
app/wp-content/uploads/2021/11/5-100x100.jpg


BIN
app/wp-content/uploads/2021/11/5-150x150.jpg


BIN
app/wp-content/uploads/2021/11/5-300x169.jpg


BIN
app/wp-content/uploads/2021/11/5-300x300.jpg


BIN
app/wp-content/uploads/2021/11/5-600x338.jpg


BIN
app/wp-content/uploads/2021/11/5-60x60.jpg


BIN
app/wp-content/uploads/2021/11/5-768x432.jpg


BIN
app/wp-content/uploads/2021/11/5.jpg


BIN
app/wp-content/uploads/2021/11/AD-1-100x100.jpg


BIN
app/wp-content/uploads/2021/11/AD-1-150x150.jpg


BIN
app/wp-content/uploads/2021/11/AD-1-300x169.jpg


BIN
app/wp-content/uploads/2021/11/AD-1-300x300.jpg


BIN
app/wp-content/uploads/2021/11/AD-1-600x338.jpg


BIN
app/wp-content/uploads/2021/11/AD-1-60x60.jpg


BIN
app/wp-content/uploads/2021/11/AD-1-768x432.jpg


BIN
app/wp-content/uploads/2021/11/AD-1.jpg


BIN
app/wp-content/uploads/2021/11/ADW-100x100.jpg


BIN
app/wp-content/uploads/2021/11/ADW-150x150.jpg


BIN
app/wp-content/uploads/2021/11/ADW-300x169.jpg


+ 0 - 0
app/wp-content/uploads/2021/11/ADW-300x300.jpg


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff

tum/whitesports - Gogs: Simplico Git Service

Ei kuvausta

class.json-api-site-jetpack-base.php 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <?php
  2. require_once dirname( __FILE__ ) . '/class.json-api-site-base.php';
  3. abstract class Abstract_Jetpack_Site extends SAL_Site {
  4. abstract protected function get_constant( $name );
  5. abstract protected function current_theme_supports( $feature_name );
  6. abstract protected function get_theme_support( $feature_name );
  7. abstract protected function get_mock_option( $name );
  8. abstract public function get_jetpack_version();
  9. abstract public function get_updates();
  10. abstract protected function main_network_site();
  11. abstract protected function wp_version();
  12. abstract protected function max_upload_size();
  13. abstract protected function is_main_network();
  14. abstract protected function is_version_controlled();
  15. abstract protected function file_system_write_access();
  16. /**
  17. * Fetch a list of active plugins that are using Jetpack Connection.
  18. */
  19. abstract protected function get_connection_active_plugins();
  20. function before_render() {
  21. }
  22. protected function wp_memory_limit() {
  23. return $this->get_constant( 'WP_MEMORY_LIMIT' );
  24. }
  25. protected function wp_max_memory_limit() {
  26. return $this->get_constant( 'WP_MAX_MEMORY_LIMIT' );
  27. }
  28. function after_render( &$response ) {
  29. // Add the updates only make them visible if the user has manage options permission and the site is the main site of the network
  30. if ( current_user_can( 'manage_options' ) && $this->is_main_site( $response ) ) {
  31. $jetpack_update = $this->get_updates();
  32. if ( ! empty( $jetpack_update ) ) {
  33. // In previous version of Jetpack 3.4, 3.5, 3.6 we synced the wp_version into to jetpack_updates
  34. unset( $jetpack_update['wp_version'] );
  35. // In previous version of Jetpack 3.4, 3.5, 3.6 we synced the site_is_version_controlled into to jetpack_updates
  36. unset( $jetpack_update['site_is_version_controlled'] );
  37. $response['updates'] = $jetpack_update;
  38. }
  39. }
  40. }
  41. function after_render_options( &$options ) {
  42. $options['jetpack_version'] = $this->get_jetpack_version();
  43. if ( $main_network_site = $this->main_network_site() ) {
  44. $options['main_network_site'] = (string) rtrim( $main_network_site, '/' );
  45. }
  46. if ( is_array( $active_modules = Jetpack_Options::get_option( 'active_modules' ) ) ) {
  47. $options['active_modules'] = (array) array_values( $active_modules );
  48. }
  49. $options['software_version'] = (string) $this->wp_version();
  50. $options['max_upload_size'] = $this->max_upload_size();
  51. $options['wp_memory_limit'] = $this->wp_memory_limit();
  52. $options['wp_max_memory_limit'] = $this->wp_max_memory_limit();
  53. // Sites have to prove that they are not main_network site.
  54. // If the sync happends right then we should be able to see that we are not dealing with a network site
  55. $options['is_multi_network'] = (bool) $this->is_main_network();
  56. $options['is_multi_site'] = (bool) $this->is_multisite();
  57. $file_mod_disabled_reasons = array_keys( array_filter( array(
  58. 'automatic_updater_disabled' => (bool) $this->get_constant( 'AUTOMATIC_UPDATER_DISABLED' ),
  59. // WP AUTO UPDATE CORE defaults to minor, '1' if true and '0' if set to false.
  60. 'wp_auto_update_core_disabled' => ! ( (bool) $this->get_constant( 'WP_AUTO_UPDATE_CORE' ) ),
  61. 'is_version_controlled' => (bool) $this->is_version_controlled(),
  62. // By default we assume that site does have system write access if the value is not set yet.
  63. 'has_no_file_system_write_access' => ! (bool) $this->file_system_write_access(),
  64. 'disallow_file_mods' => (bool) $this->get_constant( 'DISALLOW_FILE_MODS' ),
  65. ) ) );
  66. $options['file_mod_disabled'] = empty( $file_mod_disabled_reasons ) ? false : $file_mod_disabled_reasons;
  67. $options['jetpack_connection_active_plugins'] = $this->get_connection_active_plugins();
  68. }
  69. function get_jetpack_modules() {
  70. return array_values( Jetpack_Options::get_option( 'active_modules', array() ) );
  71. }
  72. function is_module_active( $module ) {
  73. return in_array ( $module, Jetpack_Options::get_option( 'active_modules', array() ), true );
  74. }
  75. function is_vip() {
  76. return false; // this may change for VIP Go sites, which sync using Jetpack
  77. }
  78. function featured_images_enabled() {
  79. return $this->current_theme_supports( 'post-thumbnails' );
  80. }
  81. function get_post_formats() {
  82. // deprecated - see separate endpoint. get a list of supported post formats
  83. $all_formats = get_post_format_strings();
  84. $supported = $this->get_theme_support( 'post-formats' );
  85. $supported_formats = array();
  86. if ( isset( $supported[0] ) ) {
  87. foreach ( $supported[0] as $format ) {
  88. $supported_formats[ $format ] = $all_formats[ $format ];
  89. }
  90. }
  91. return $supported_formats;
  92. }
  93. function get_icon() {
  94. $icon_id = get_option( 'site_icon' );
  95. if ( empty( $icon_id ) ) {
  96. $icon_id = Jetpack_Options::get_option( 'site_icon_id' );
  97. }
  98. if ( empty( $icon_id ) ) {
  99. return null;
  100. }
  101. $icon = array_filter( array(
  102. 'img' => wp_get_attachment_image_url( $icon_id, 'full' ),
  103. 'ico' => wp_get_attachment_image_url( $icon_id, array( 16, 16 ) )
  104. ) );
  105. if ( empty( $icon ) ) {
  106. return null;
  107. }
  108. if ( current_user_can( 'edit_posts', $icon_id ) ) {
  109. $icon['media_id'] = (int) $icon_id;
  110. }
  111. return $icon;
  112. }
  113. /**
  114. * Private methods
  115. **/
  116. private function is_main_site( $response ) {
  117. if ( isset( $response['options']->main_network_site, $response['options']->unmapped_url ) ) {
  118. $main_network_site_url = set_url_scheme( $response['options']->main_network_site, 'http' );
  119. $unmapped_url = set_url_scheme( $response['options']->unmapped_url, 'http' );
  120. if ( $unmapped_url === $main_network_site_url ) {
  121. return true;
  122. }
  123. }
  124. return false;
  125. }
  126. // For Jetpack sites this will always return false
  127. protected function is_a8c_publication( $post_id ) {
  128. return false;
  129. }
  130. }