Advertisement
Guest User

Manual content-search.php

a guest
Nov 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. <?php global $theme_options; ?>
  2. <div class="search <?php echo get_post_type(); ?>" id="post-<?php the_ID(); ?>">
  3. <div class="caption">
  4. <?php the_title( sprintf( '<h4><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h4>' ); ?>
  5. <p>
  6. <?php if( $theme_options['searchpg-records-publish-date'] == true ) { ?>
  7. <i class="fa fa-calendar"></i> <span>
  8. <?php the_time( get_option('date_format') ); ?>
  9. </span>
  10. <?php } ?>
  11. <?php if( $theme_options['searchpg-records-author-name'] == true ) { ?>
  12. <i class="fa fa-user"></i> <span>
  13. <?php $author_id = $post->post_author; echo the_author_meta( $theme_options['searchpg-records-post-user-name'] , $author_id ); ?>
  14. </span>
  15. <?php } ?>
  16. <?php
  17. if ( 'post' == get_post_type() ) {
  18. edit_post_link( esc_html__( 'Edit', 'manual' ), '<i class="fa fa-edit"></i> <span class="edit-link">', '</span>' );
  19. } else {
  20. edit_post_link( esc_html__( 'Edit', 'manual' ), '<i class="fa fa-edit"></i> <span class="edit-link">', '</span>' );
  21. }
  22. ?>
  23. </p>
  24. <?php
  25. if( $theme_options['searchpg-display-post-content'] == true ) {
  26. foreach ( $theme_options['searchpg-display-post-content-on-post-type'] as $post_type ) {
  27. if( $post_type == get_post_type( $post ) ) {
  28. echo '<p class="search-content">';
  29. $content = get_the_content($post->ID);
  30. echo substr(strip_tags($content), 0, ($theme_options['searchpg-display-post-content-character']?$theme_options['searchpg-display-post-content-character']:200) );
  31. echo '</p>';
  32. }
  33. }
  34. }
  35. ?>
  36. </div>
  37. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement