Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] problem z kodem
wazniak
post
Post #1





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 15.12.2009

Ostrzeżenie: (0%)
-----


<?php wpn_content_limit(get_the_content(),140); ?>
Chodzi mi o ten kod, jak potrzeba więcej to napiszcie wkleję (IMG:style_emoticons/default/winksmiley.jpg)
Sprawa jest prosta, chcę żeby pokazywał on na przykład od 60 znaku do 140 znaku a niestety nie wiem jak się do tego zabrać.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
wazniak
post
Post #2





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 15.12.2009

Ostrzeżenie: (0%)
-----


  1. <!-- Articles // -->
  2. <div class="ftop">
  3. <div class="featured">
  4. <div class="fthumbs">
  5. <?php $i = 0; $featured = new WP_Query("cat=".get_wpn_config('featured_category_id')."&showposts=5"); while($featured->have_posts()) : $featured->the_post();?>
  6. <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><img src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="" <?php if($i == 0) echo 'class="active" '; ?>/></a><br />
  7. <?php $i++; endwhile; $i = 0; ?>
  8. </div>
  9. <div class="fwrap">
  10. <ul>
  11. <?php $featured = new WP_Query("cat=".get_wpn_config('featured_category_id')."&showposts=5"); while($featured->have_posts()) : $featured->the_post();?>
  12. <li>
  13. <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><img src="<?php echo get_post_meta($post->ID, "featured_thumbnail", true); ?>" width="200" height="50" />
  14. <div>
  15. <a class="title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br />
  16. <?php wpn_content_limit(get_the_content(),140); ?>
  17. <a href="<?php the_permalink(); ?>">more</a>
  18. </div>
  19. </li>
  20. <?php endwhile; ?>
  21. </ul>
  22. </div>
  23. </div>
  24. <div class="top">
  25. <span class="heading1"><span>Articles</span></span>
  26. <ul>
  27. <?php
  28. $sql = "
  29. SELECT *
  30. FROM $wpdb->posts
  31. WHERE post_date_gmt > ".(time()-strtotime('-2 weeks'))." AND post_type = 'post'
  32. ORDER BY comment_count DESC LIMIT 5
  33. ";
  34.  
  35. $top_posts = $wpdb->get_results($sql);
  36.  
  37. foreach ($top_posts as $post) {
  38. ?>
  39. <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><span><a class="comments" href="<?php the_permalink(); ?>#comments"><?php echo $post->comment_count; ?> Comments</a>Posted Under: <?php the_category(', '); ?></span></li>
  40. <?
  41. }
  42. ?>
  43. </ul>
  44. </div>
  45. <div class="clear"></div>
  46. </div>
  47. <!-- // Articles -->
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 18.10.2025 - 14:21