Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Ukrycie pola, jeśli nie wypełnione
senior.pol
post
Post #1





Grupa: Zarejestrowani
Postów: 158
Pomógł: 0
Dołączył: 10.08.2011

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


Witam,
Używam wordpressa z wtyczką Advance Custom Fields i chcę dodać jedną regułę - ukrywać pole "rabat" - 11$s, jeśli nie zostało wypełnione.
  1. <div <?php post_class("loop ".$item_style." ".$color_set." ". $portfolio_format)?> id="portfolio-<?php the_ID(); ?>">
  2. <?php
  3.  
  4. ....
  5.  
  6. //output
  7. if( $item_style == "style-1" ){
  8.  
  9. printf('
  10. <figure class="image-thumbnail">
  11. <a href="%2$s" target="%3$s" title="%4$s">%1$s</a>
  12. </figure>
  13.  
  14. <section class="text">
  15. %5$s
  16. %6$s
  17. %7$s
  18. %8$s
  19. </section>
  20. ', $thumbnail_image_output, $permalink, $target, $title, $title_output, $term_list, $desc_output, $read_more );
  21.  
  22. }else{
  23.  
  24. printf('
  25.  
  26. <figure class="image-thumbnail">
  27. %1$s
  28. <div class="rabat">
  29. &minus;%11$s&#x25;
  30. </div>
  31. <div class="description">
  32. <table cellspacing="0" style="border-collapse: collapse; border: none;">
  33. <tr>
  34. <td><span class="icon-line-anchor icon"> %8$s</span></td>
  35. <td><span class="icon-new-user-1 icon"> max %9$s</span></td>
  36. <td><span class="icon-line-cart icon"> od %10$s PLN</span></td>
  37. </tr>
  38. </table>
  39. </div>
  40. </figure>
  41. <div class="overlay">
  42. <a href="%2$s" target="%3$s" title="%4$s"></a>
  43.  
  44. <section class="text">
  45. %5$s
  46. %6$s
  47. %7$s
  48. </section>
  49.  
  50. </div>
  51.  
  52. ', $thumbnail_image_output, $permalink, $target, $title, $title_output, $term_list, $desc_output, get_field('port'), get_field('zaloga'), get_field('cena'), get_field('rabat'));
  53. }
  54.  
  55. ?>
  56.  
  57. </div>


Z PHP jestem noga sadsmiley02.gif

Ktoś może mi pomóc?

Da radę coś z tym zrobić?
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 20.08.2025 - 06:01