Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. <?php
  2. $content = apply_filters( 'the_content', get_the_content() );
  3. $contentWithoutHTML = wp_strip_all_tags($content);
  4. $pos = strpos($contentWithoutHTML, " ", 100);
  5. $contentFinal = substr($contentWithoutHTML,0,$pos );
  6. echo $contentFinal . "...";
  7. ?>
  8.  
  9. <?php
  10. $args = array(
  11. 'orderby' => 'ID',
  12. 'order' => 'ASC',
  13. 'posts_per_page' => 7,
  14. 'meta_query' => array(
  15. array(
  16. 'key' => '_thumbnail_id'
  17. )
  18. )
  19. );
  20. $query = new WP_Query($args);
  21. while ($query->have_posts()):
  22. $query->the_post();
  23. ?>
  24. <div class="articleboxs boxs">
  25. <div class="col-sm-4 noleft">
  26. <div class="aricleleft boxs">
  27. <?php the_post_thumbnail('medium', array(
  28. 'class' => 'img-responsive'
  29. )) ?>
  30. </div>
  31. </div>
  32. <div class="col-sm-8 noright">
  33. <div class="aricleright boxs">
  34. <div class="boxs">
  35. <a href="<?php echo get_permalink(); ?>"><h2 class="heading font_Libre"><?php the_title(); ?></h2></a>
  36. <?php
  37. $content = apply_filters('the_content', get_the_content('', true));
  38. print_r($content);
  39. $contentWithoutHTML = wp_strip_all_tags($content);
  40. $pos = strpos($contentWithoutHTML, " ", 100);
  41. $contentFinal = substr($contentWithoutHTML, 0, $pos);
  42. ?>
  43. <p class="font_Roboto"><?php echo $contentFinal . "..."; ?></p>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <?php
  49. endwhile;
  50. wp_reset_postdata();
  51. ?>
  52.  
  53. $content = mb_strimwidth(wp_strip_all_tags(get_the_content()), 0, 100, '...');
  54. echo $content;
  55.  
  56. <?php
  57. $contentWithoutHTML = wp_strip_all_tags($post->post_content);
  58. $pos = strpos($contentWithoutHTML, " ", 100);
  59. $contentFinal = substr($contentWithoutHTML,0,$pos );
  60. ?>
  61. <p class="font_Roboto"><?php echo $contentFinal . "..."; ?></p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement