integrations
7 years ago
class-strong-form.php
7 years ago
class-strong-log.php
7 years ago
class-strong-mail.php
7 years ago
class-strong-templates.php
7 years ago
class-strong-testimonials-order.php
7 years ago
class-strong-testimonials-privacy.php
7 years ago
class-strong-testimonials-render.php
7 years ago
class-strong-testimonials-shortcode-average.php
7 years ago
class-strong-testimonials-shortcode-count.php
7 years ago
class-strong-testimonials-shortcode.php
7 years ago
class-strong-view-display.php
7 years ago
class-strong-view-form.php
7 years ago
class-strong-view-slideshow.php
7 years ago
class-strong-view.php
7 years ago
class-walker-strong-category-checklist-front.php
7 years ago
deprecated.php
7 years ago
filters.php
7 years ago
functions-activation.php
7 years ago
functions-content.php
7 years ago
functions-image.php
7 years ago
functions-rating.php
7 years ago
functions-template-form.php
7 years ago
functions-template.php
7 years ago
functions-views.php
7 years ago
functions.php
7 years ago
l10n-polylang.php
7 years ago
l10n-wpml.php
7 years ago
post-types.php
7 years ago
retro.php
7 years ago
scripts.php
7 years ago
widget2.php
7 years ago
functions-template.php
605 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Template Functions |
| 4 | */ |
| 5 | |
| 6 | /** |
| 7 | * Template function for showing a View. |
| 8 | * |
| 9 | * @since 1.25.0 |
| 10 | * |
| 11 | * @param null $id |
| 12 | */ |
| 13 | function strong_testimonials_view( $id = null ) { |
| 14 | if ( ! $id ) { |
| 15 | return; |
| 16 | } |
| 17 | |
| 18 | $out = array(); |
| 19 | $pairs = array(); |
| 20 | $atts = array( 'id' => $id ); |
| 21 | $out = WPMST()->render->parse_view( $out, $pairs, $atts ); |
| 22 | |
| 23 | echo WPMST()->shortcode->render_view( $out ); |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Print the current post title with optional markup. |
| 28 | * |
| 29 | * @since 2.26.0 Add optional link to post. |
| 30 | * |
| 31 | * @param string $before |
| 32 | * @param string $after |
| 33 | */ |
| 34 | function wpmtst_the_title( $before = '', $after = '' ) { |
| 35 | $title = get_the_title(); |
| 36 | |
| 37 | if ( WPMST()->atts( 'title' ) && $title ) { |
| 38 | |
| 39 | if ( WPMST()->atts( 'title_link' ) ) { |
| 40 | $before .= '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">'; |
| 41 | $after = '</a>' . $after; |
| 42 | } |
| 43 | |
| 44 | the_title( $before, $after ); |
| 45 | |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Display the testimonial content. |
| 51 | * |
| 52 | * @since 1.24.0 |
| 53 | * |
| 54 | * @since 2.4.0 Run content through core WordPress filters only, instead of all filters |
| 55 | * added to the_excerpt() or the_content() in order to to be compatible with |
| 56 | * NextGEN Gallery and to prevent other plugins from unconditionally adding |
| 57 | * content like share buttons, etc. |
| 58 | * |
| 59 | * @since 2.11.5 Run specific filters on `wpmtst_the_content` hook. |
| 60 | * |
| 61 | * @since 2.20.0 For automatic excerpts, run `wpautop` after truncating. |
| 62 | * Add `wp_make_content_images_responsive`. |
| 63 | * |
| 64 | * @since 2.26.0 Using content filters instead of direct function calls. |
| 65 | * Using custom get_*() functions to allow filter selectivity. |
| 66 | */ |
| 67 | function wpmtst_the_content() { |
| 68 | /** |
| 69 | * Use this hook to remove specific content filters. |
| 70 | * |
| 71 | * @since 2.26.0 |
| 72 | */ |
| 73 | do_action( 'wpmtst_before_content_filters' ); |
| 74 | |
| 75 | echo apply_filters( 'wpmtst_get_the_content', '' ); |
| 76 | |
| 77 | /** |
| 78 | * Restore content filters that were removed. |
| 79 | * |
| 80 | * @since 2.26.0 |
| 81 | */ |
| 82 | do_action( 'wpmtst_after_content_filters' ); |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Like the_excerpt(). |
| 87 | * |
| 88 | * @since 2.33.0 |
| 89 | */ |
| 90 | function wpmtst_the_excerpt() { |
| 91 | echo wpmtst_the_excerpt_filtered(); |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * The ellipsis on read-more's. |
| 96 | * |
| 97 | * @since 2.33.0 |
| 98 | */ |
| 99 | function wpmtst_ellipsis() { |
| 100 | if ( apply_filters( 'wpmtst_use_ellipsis', true ) ) { |
| 101 | return apply_filters( 'wpmtst_ellipsis', __( '…', 'strong-testimonials' ) ); |
| 102 | } |
| 103 | |
| 104 | return ''; |
| 105 | } |
| 106 | |
| 107 | function wpmtst_prepend_ellipsis( $more ) { |
| 108 | return wpmtst_ellipsis() . ' ' . $more; |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * Assemble link to secondary "Read more" page. |
| 113 | * |
| 114 | * @since 2.10.0 |
| 115 | */ |
| 116 | function wpmtst_read_more_page() { |
| 117 | $atts = WPMST()->atts(); |
| 118 | |
| 119 | if ( $atts['more_page'] && $atts['more_page_id'] ) { |
| 120 | |
| 121 | $permalink = ''; |
| 122 | if ( is_numeric( $atts['more_page_id'] ) ) { |
| 123 | $permalink = wpmtst_get_permalink( $atts['more_page_id'] ); |
| 124 | } |
| 125 | $permalink = apply_filters( 'wpmtst_readmore_page_link', $permalink, $atts ); |
| 126 | |
| 127 | if ( $permalink ) { |
| 128 | $default_view = wpmtst_get_view_default(); |
| 129 | |
| 130 | if ( isset( $atts['more_page_text'] ) && $atts['more_page_text'] ) { |
| 131 | $link_text = $atts['more_page_text']; |
| 132 | } else { |
| 133 | $link_text = $default_view['more_page_text']; |
| 134 | } |
| 135 | |
| 136 | $link_text = apply_filters( 'wpmtst_read_more_page_link_text', $link_text, $atts ); |
| 137 | |
| 138 | if ( 'wpmtst_after_testimonial' == $atts['more_page_hook'] ) { |
| 139 | $classname = 'readmore'; |
| 140 | } else { |
| 141 | $classname = 'readmore-page'; |
| 142 | } |
| 143 | $classname = apply_filters( 'wpmtst_read_more_page_class', $classname ); |
| 144 | echo apply_filters('wpmtst_read_more_page_output', sprintf( '<div class="%s"><a href="%s">%s</a></div>', $classname, esc_url( $permalink ), $link_text )); |
| 145 | } |
| 146 | |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | * L10n filter on read-more-page link. |
| 152 | * |
| 153 | * @since 2.23.0 As separate function. |
| 154 | * |
| 155 | * @param $text |
| 156 | * @param $atts |
| 157 | * |
| 158 | * @return string |
| 159 | */ |
| 160 | function wpmtst_read_more_page_link_text_l10n( $text, $atts ) { |
| 161 | return apply_filters( 'wpmtst_l10n', $text, 'strong-testimonials-read-more', |
| 162 | sprintf( 'View %s : Read more (page or post)', $atts['view'] ) ); |
| 163 | |
| 164 | } |
| 165 | add_filter( 'wpmtst_read_more_page_link_text', 'wpmtst_read_more_page_link_text_l10n', 10, 2 ); |
| 166 | |
| 167 | /** |
| 168 | * L10n filter on read-more-post link. |
| 169 | * |
| 170 | * @since 2.29.0 |
| 171 | * |
| 172 | * @param $text |
| 173 | * @param $atts |
| 174 | * |
| 175 | * @return string |
| 176 | */ |
| 177 | function wpmtst_read_more_post_link_text_l10n( $text, $atts ) { |
| 178 | return apply_filters( 'wpmtst_l10n', $text, 'strong-testimonials-read-more', |
| 179 | sprintf( 'View %s : Read more (testimonial)', $atts['view'] ) ); |
| 180 | |
| 181 | } |
| 182 | add_filter( 'wpmtst_read_more_post_link_text', 'wpmtst_read_more_post_link_text_l10n', 10, 2 ); |
| 183 | |
| 184 | /** |
| 185 | * Get permalink by ID or slug. |
| 186 | * |
| 187 | * @since 1.25.0 |
| 188 | * |
| 189 | * @param $page_id |
| 190 | * |
| 191 | * @return false|string |
| 192 | */ |
| 193 | function wpmtst_get_permalink( $page_id ) { |
| 194 | if ( ! is_numeric( $page_id ) ) { |
| 195 | $page = get_page_by_path( $page_id ); |
| 196 | $page_id = $page->ID; |
| 197 | } |
| 198 | |
| 199 | return get_permalink( $page_id ); |
| 200 | } |
| 201 | |
| 202 | /** |
| 203 | * Prevent page scroll when clicking the More link. |
| 204 | * |
| 205 | * @since 2.10.0 |
| 206 | * |
| 207 | * @param $link |
| 208 | * |
| 209 | * @return mixed |
| 210 | */ |
| 211 | function wpmtst_remove_more_link_scroll( $link ) { |
| 212 | if ( 'wpm-testimonial' == get_post_type() ) { |
| 213 | $link = preg_replace( '|#more-[0-9]+|', '', $link ); |
| 214 | } |
| 215 | |
| 216 | return $link; |
| 217 | } |
| 218 | add_filter( 'the_content_more_link', 'wpmtst_remove_more_link_scroll' ); |
| 219 | |
| 220 | /** |
| 221 | * Display the thumbnail. |
| 222 | * |
| 223 | * TODO WP 4.2+ has better filters. |
| 224 | * |
| 225 | * @param null $size |
| 226 | * @param string $before |
| 227 | * @param string $after |
| 228 | */ |
| 229 | function wpmtst_the_thumbnail( $size = null, $before = '<div class="testimonial-image">', $after = '</div>' ) { |
| 230 | if ( ! WPMST()->atts( 'thumbnail' ) ) { |
| 231 | return; |
| 232 | } |
| 233 | |
| 234 | $img = wpmtst_get_thumbnail( $size ); |
| 235 | if ( $img ) { |
| 236 | echo $before . $img . $after; |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | /** |
| 241 | * Print the date. |
| 242 | * |
| 243 | * @param string $format |
| 244 | * @param string $class |
| 245 | */ |
| 246 | function wpmtst_the_date( $format = '', $class = '' ) { |
| 247 | global $post; |
| 248 | if ( ! $post ) { |
| 249 | return; |
| 250 | } |
| 251 | |
| 252 | if ( ! $format ) { |
| 253 | $format = get_option( 'date_format' ); |
| 254 | } |
| 255 | |
| 256 | $the_date = apply_filters( 'wpmtst_the_date', mysql2date( $format, $post->post_date ), $format, $post ); |
| 257 | echo '<div class="' . $class . '">' . $the_date . '</div>'; |
| 258 | } |
| 259 | |
| 260 | /** |
| 261 | * Display the client section. |
| 262 | * |
| 263 | * @since 1.21.0 |
| 264 | */ |
| 265 | function wpmtst_the_client() { |
| 266 | $atts = WPMST()->atts(); |
| 267 | if ( isset( $atts['client_section'] ) ) { |
| 268 | echo wpmtst_client_section( $atts['client_section'] ); |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | /** |
| 273 | * Assemble the client section. |
| 274 | * |
| 275 | * @since 1.21.0 |
| 276 | * |
| 277 | * @param array $client_section An array of client fields. |
| 278 | * |
| 279 | * @return mixed |
| 280 | */ |
| 281 | function wpmtst_client_section( $client_section ) { |
| 282 | global $post; |
| 283 | |
| 284 | $options = get_option( 'wpmtst_options' ); |
| 285 | $custom_fields = wpmtst_get_custom_fields(); |
| 286 | $html = ''; |
| 287 | |
| 288 | foreach ( $client_section as $field ) { |
| 289 | $output = ''; |
| 290 | $field_name = $field['field']; |
| 291 | if ( isset( $custom_fields[ $field_name ] ) ) { |
| 292 | $field['prop'] = $custom_fields[ $field_name ]; |
| 293 | } |
| 294 | else { |
| 295 | $field['prop'] = array(); |
| 296 | } |
| 297 | |
| 298 | // Check for callback first. |
| 299 | if ( isset( $field['prop']['action_output'] ) && $field['prop']['action_output'] ) { |
| 300 | $value = get_post_meta( $post->ID, $field_name, true ); |
| 301 | $output = apply_filters( $field['prop']['action_output'], $field, $value ); |
| 302 | } |
| 303 | //TODO Convert all to filters. |
| 304 | // Check field type. |
| 305 | else { |
| 306 | switch ( $field['type'] ) { |
| 307 | |
| 308 | case 'link' : |
| 309 | case 'link2' : |
| 310 | // use default if missing |
| 311 | if ( ! isset( $field['link_text'] ) ) { |
| 312 | $field['link_text'] = 'value'; |
| 313 | } |
| 314 | |
| 315 | /** |
| 316 | * Get link text and an alternate in case the URL is empty; |
| 317 | * e.g. display the domain if no company name given |
| 318 | * but don't display 'LinkedIn' if no URL given. |
| 319 | */ |
| 320 | switch ( $field['link_text'] ) { |
| 321 | case 'custom' : |
| 322 | $text = $field['link_text_custom']; |
| 323 | $output = ''; |
| 324 | break; |
| 325 | case 'label' : |
| 326 | $text = $field['prop']['label']; |
| 327 | $output = ''; |
| 328 | break; |
| 329 | default : // value |
| 330 | $text = get_post_meta( $post->ID, $field_name, true ); |
| 331 | // if no URL (next condition), show the alternate (the field) |
| 332 | $output = $text; |
| 333 | } |
| 334 | |
| 335 | if ( $field['url'] ) { |
| 336 | |
| 337 | $url = get_post_meta( $post->ID, $field['url'], true ); |
| 338 | if ( $url ) { |
| 339 | if ( isset( $field['new_tab'] ) && $field['new_tab'] ) { |
| 340 | $newtab = ' target="_blank"'; |
| 341 | } |
| 342 | else { |
| 343 | $newtab = ''; |
| 344 | } |
| 345 | |
| 346 | // TODO Abstract this global fallback technique. |
| 347 | $is_nofollow = get_post_meta( $post->ID, 'nofollow', true ); |
| 348 | if ( 'default' == $is_nofollow || '' == $is_nofollow ) { |
| 349 | // convert default to (yes|no) |
| 350 | $is_nofollow = $options['nofollow'] ? 'yes' : 'no'; |
| 351 | } |
| 352 | if ( 'yes' == $is_nofollow ) { |
| 353 | $nofollow = ' rel="nofollow"'; |
| 354 | } |
| 355 | else { |
| 356 | $nofollow = ''; |
| 357 | } |
| 358 | |
| 359 | // if field empty, use domain instead |
| 360 | if ( ! $text || is_array( $text ) ) { |
| 361 | $text = preg_replace( '(^https?://)', '', $url ); |
| 362 | } |
| 363 | |
| 364 | $output = sprintf( '<a href="%s"%s%s>%s</a>', $url, $newtab, $nofollow, $text ); |
| 365 | } |
| 366 | |
| 367 | } |
| 368 | break; |
| 369 | |
| 370 | case 'date' : |
| 371 | $format = isset( $field['format'] ) && $field['format'] ? $field['format'] : get_option( 'date_format' ); |
| 372 | |
| 373 | // Fall back to post_date if submit_date missing. |
| 374 | $the_date = get_post_meta( $post->ID, $field_name, true ); |
| 375 | $the_date = $the_date ? $the_date : $post->post_date; |
| 376 | $the_date = mysql2date( $format, $the_date ); |
| 377 | |
| 378 | if ( get_option( 'date_format' ) != $format ) { |
| 379 | // Requires PHP 5.3+ |
| 380 | if ( version_compare( PHP_VERSION, '5.3' ) >= 0 ) { |
| 381 | $new_date = DateTime::createFromFormat( get_option( 'date_format' ), $the_date ); |
| 382 | if ( $new_date ) { |
| 383 | $the_date = $new_date->format( $format ); |
| 384 | } |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | $output = apply_filters( 'wpmtst_the_date', $the_date, $format, $post ); |
| 389 | break; |
| 390 | |
| 391 | case 'category' : |
| 392 | $categories = get_the_terms( $post->ID, 'wpm-testimonial-category' ); |
| 393 | if ( $categories && ! is_wp_error( $categories ) ) { |
| 394 | $list = array(); |
| 395 | foreach ( $categories as $cat ) { |
| 396 | $list[] = $cat->name; |
| 397 | } |
| 398 | $output = join( ", ", $list ); |
| 399 | } |
| 400 | else { |
| 401 | $output = ''; |
| 402 | } |
| 403 | break; |
| 404 | |
| 405 | case 'shortcode' : |
| 406 | if ( isset( $field['prop']['shortcode_on_display'] ) && $field['prop']['shortcode_on_display'] ) { |
| 407 | $output = do_shortcode( $field['prop']['shortcode_on_display'] ); |
| 408 | } |
| 409 | break; |
| 410 | |
| 411 | case 'rating' : |
| 412 | $output = get_post_meta( $post->ID, $field_name, true ); |
| 413 | // Check default value |
| 414 | if ( '' == $output && isset( $field['prop']['default_display_value'] ) && $field['prop']['default_display_value'] ) { |
| 415 | $output = $field['prop']['default_display_value']; |
| 416 | } |
| 417 | // Convert number to stars |
| 418 | if ( $output ) { |
| 419 | $output = wpmtst_star_rating_display( $output, 'in-view', false ); |
| 420 | } |
| 421 | break; |
| 422 | |
| 423 | default : |
| 424 | // text field |
| 425 | $output = get_post_meta( $post->ID, $field_name, true ); |
| 426 | if ( '' == $output && isset( $field['prop']['default_display_value'] ) && $field['prop']['default_display_value'] ) { |
| 427 | $output = $field['prop']['default_display_value']; |
| 428 | } |
| 429 | |
| 430 | } |
| 431 | } |
| 432 | |
| 433 | if ( $output ) { |
| 434 | if ( isset( $field['before'] ) && $field['before'] ) { |
| 435 | $output = '<span class="testimonial-field-before">' . $field['before'] . '</span>' . $output; |
| 436 | } |
| 437 | $html .= '<div class="' . $field['class'] . '">' . $output . '</div>'; |
| 438 | } |
| 439 | } |
| 440 | |
| 441 | return $html; |
| 442 | } |
| 443 | |
| 444 | function wpmtst_container_class() { |
| 445 | echo apply_filters( 'wpmtst_container_class', WPMST()->atts( 'container_class' ) ); |
| 446 | } |
| 447 | |
| 448 | function wpmtst_container_data() { |
| 449 | $data_array = apply_filters( 'wpmtst_container_data', WPMST()->atts( 'container_data' ) ); |
| 450 | if ( $data_array ) { |
| 451 | $data = ''; |
| 452 | foreach ( $data_array as $attr => $value ) { |
| 453 | $data .= " data-$attr=$value"; |
| 454 | } |
| 455 | echo $data; |
| 456 | } |
| 457 | } |
| 458 | |
| 459 | function wpmtst_content_class() { |
| 460 | echo apply_filters( 'wpmtst_content_class', WPMST()->atts( 'content_class' ) ); |
| 461 | } |
| 462 | |
| 463 | function wpmtst_post_class( $args = null ) { |
| 464 | echo apply_filters( 'wpmtst_post_class', WPMST()->atts( 'post_class' ) . ' post-' . get_the_ID(), $args ); |
| 465 | } |
| 466 | |
| 467 | /** |
| 468 | * Echo custom field. |
| 469 | * |
| 470 | * @since 1.11.0 |
| 471 | * |
| 472 | * @param null $field |
| 473 | * @param array $args |
| 474 | */ |
| 475 | function wpmtst_field( $field = null, $args = array() ) { |
| 476 | echo wpmtst_get_field( $field, $args ); |
| 477 | } |
| 478 | |
| 479 | /** |
| 480 | * Fetch custom field. |
| 481 | * |
| 482 | * Thanks to Matthew Harris. |
| 483 | * |
| 484 | * @link https://github.com/cdillon/strong-testimonials/issues/2 |
| 485 | * |
| 486 | * @param $field |
| 487 | * @param array $args |
| 488 | * |
| 489 | * @since 1.15.7 |
| 490 | * |
| 491 | * @return mixed|string |
| 492 | */ |
| 493 | function wpmtst_get_field( $field, $args = array() ) { |
| 494 | if ( ! $field ) { |
| 495 | return ''; |
| 496 | } |
| 497 | |
| 498 | global $post; |
| 499 | |
| 500 | switch ( $field ) { |
| 501 | |
| 502 | // Apply a character limit to post content. |
| 503 | case 'truncated' : |
| 504 | $html = wpmtst_truncate( $post->post_content, $args['char_limit'] ); |
| 505 | break; |
| 506 | |
| 507 | // Get the custom field. |
| 508 | default : |
| 509 | $html = get_post_meta( $post->ID, $field, true ); |
| 510 | |
| 511 | } |
| 512 | |
| 513 | return $html; |
| 514 | } |
| 515 | |
| 516 | if ( ! function_exists( 'wpmtst_standard_pagination' ) ) : |
| 517 | /** |
| 518 | * Custom pagination. Pluggable. |
| 519 | * |
| 520 | * Thanks http://callmenick.com/post/custom-wordpress-loop-with-pagination |
| 521 | */ |
| 522 | function wpmtst_standard_pagination() { |
| 523 | $query = WPMST()->get_query(); |
| 524 | $numpages = $query->max_num_pages ? $query->max_num_pages : 1; |
| 525 | $paged = wpmtst_get_paged(); |
| 526 | $options = WPMST()->atts( 'pagination_settings' ); |
| 527 | |
| 528 | $pagination_args = array( |
| 529 | // Required |
| 530 | 'total' => $numpages, |
| 531 | 'current' => $paged, |
| 532 | // Options |
| 533 | 'show_all' => isset( $options['show_all'] ) ? $options['show_all'] : false, |
| 534 | 'end_size' => isset( $options['end_size'] ) ? $options['end_size'] : 1, |
| 535 | 'mid_size' => isset( $options['mid_size'] ) ? $options['mid_size'] : 2, |
| 536 | 'prev_next' => isset( $options['prev_next'] ) ? $options['prev_next'] : true, |
| 537 | 'prev_text' => isset( $options['prev_text'] ) ? $options['prev_text'] : __( '« Previous', 'strong-testimonials' ), |
| 538 | 'next_text' => isset( $options['next_text'] ) ? $options['next_text'] : __( 'Next »', 'strong-testimonials' ), |
| 539 | 'before_page_number' => isset( $options['before_page_number'] ) ? $options['before_page_number'] : '', |
| 540 | 'after_page_number' => isset( $options['after_page_number'] ) ? $options['after_page_number'] : '', |
| 541 | ); |
| 542 | |
| 543 | $paginate_links = paginate_links( apply_filters( 'wpmtst_pagination_args', $pagination_args ) ); |
| 544 | |
| 545 | if ( $paginate_links ) { |
| 546 | echo "<nav class='nav-links'>"; |
| 547 | //echo "<span class='page-numbers page-num'>Page " . $paged . " of " . $numpages . "</span> "; |
| 548 | echo $paginate_links; |
| 549 | echo "</nav>"; |
| 550 | } |
| 551 | } |
| 552 | endif; |
| 553 | |
| 554 | /** |
| 555 | * If paged, return the current page number. |
| 556 | * |
| 557 | * @return int|mixed |
| 558 | */ |
| 559 | function wpmtst_get_paged() { |
| 560 | return get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; |
| 561 | } |
| 562 | |
| 563 | /* |
| 564 | // alternate pagination style |
| 565 | function wpmtst_new_pagination_2() { |
| 566 | $query = WPMST()->get_query(); |
| 567 | if ($query->max_num_pages > 1) { ?> |
| 568 | <nav class="prev-next-posts"> |
| 569 | <div class="prev-posts-link"> |
| 570 | <?php echo get_next_posts_link( 'Older Entries', $query->max_num_pages ); // display older posts link ?> |
| 571 | </div> |
| 572 | <div class="next-posts-link"> |
| 573 | <?php echo get_previous_posts_link( 'Newer Entries' ); // display newer posts link ?> |
| 574 | </div> |
| 575 | </nav> |
| 576 | <?php } |
| 577 | } |
| 578 | */ |
| 579 | |
| 580 | if ( ! function_exists( 'wpmtst_single_template_client' ) ) : |
| 581 | /** |
| 582 | * Single testimonial custom fields. Pluggable. |
| 583 | * |
| 584 | * @since 2.22.0 |
| 585 | */ |
| 586 | function wpmtst_single_template_client() { |
| 587 | $html = ''; |
| 588 | $view = wpmtst_find_single_template_view(); |
| 589 | if ( $view && isset( $view['client_section'] ) ) { |
| 590 | foreach ( $view['client_section'] as $field ) { |
| 591 | if ( 'rating' == $field['type'] ) { |
| 592 | wp_enqueue_style( 'wpmtst-rating-display' ); |
| 593 | break; |
| 594 | } |
| 595 | } |
| 596 | |
| 597 | $html .= '<div class="testimonial-client normal">'; |
| 598 | $html .= wpmtst_client_section( $view['client_section'] ); |
| 599 | $html .= '</div>'; |
| 600 | } |
| 601 | |
| 602 | return $html; |
| 603 | } |
| 604 | endif; |
| 605 |