Witam,

Mam pewien problem z wordpressem. Chciałbym aby na stronie kategorii pojawił się pod tytułem wpisu plik załącznika.
Kod pliku który, jak mi się wydaje, odpowiada za wygląd tych podstron wklejam poniżej. Funkacja która odpowiada za wyświetlanie downloadu to:
  1. <?php da_display_download_attachments(); ?>

jednak kiedy wstawię ją tak jak niżej ( linia 46 ) pliki na stronie pojawiają się w dwóch miejscach: http://www.probamikrofonu.pl/test/?cat=11 . Chciałbym aby div "Załączniki do pobrania" był tylko pod tytułem. Co robię źle ?


  1. <?php
  2. // $style = 'post' or 'block' or 'vmenu' or 'simple'
  3. function theme_wrapper($style, $args){
  4. $func_name = "theme_{$style}_wrapper";
  5. if (function_exists($func_name)) {
  6. call_user_func($func_name, $args);
  7. } else {
  8. theme_block_wrapper($args);
  9. }
  10. }
  11.  
  12. function theme_post_wrapper($args = '') {
  13. $args = wp_parse_args($args,
  14. 'id' => '',
  15. 'class' => '',
  16. 'title' => '',
  17. 'heading' => 'h2',
  18. 'thumbnail' => '',
  19. 'before' => '',
  20. 'content' => '',
  21. 'after' => ''
  22. )
  23. );
  24. extract($args);
  25. if (theme_is_empty_html($title) && theme_is_empty_html($content)) return;
  26. if ($id) {
  27. $id = ' id="' . $id . '"';
  28. }
  29. if ($class) {
  30. $class = ' ' . $class;
  31. }
  32. ?>
  33. <div class="wto-box wto-post<?php echo $class; ?>"<?php echo $id; ?>>
  34. <div class="wto-box-body wto-post-body">
  35. <div class="wto-post-inner wto-article">
  36. <?php
  37. if (!theme_is_empty_html($title)){
  38. echo '<'.$heading.' class="wto-postheader">'.$title.'</'.$heading.'>';
  39. }
  40. echo $before;echo $thumbnail;
  41. ?>
  42.  
  43. <div class="wto-postcontent">
  44.  
  45. <?php da_display_download_attachments(); ?>
  46.  
  47.  
  48. <!-- article-content -->
  49. <?php
  50. echo $content;
  51. ?>
  52. <!-- /article-content -->
  53.  
  54. </div>
  55. <div class="cleared"></div>
  56. <?php
  57. echo $after;
  58. ?>
  59. </div>
  60. <div class="cleared"></div>
  61. </div>
  62. </div>
  63.  
  64. <?php
  65. }
  66.  
  67. function theme_simple_wrapper($args = '') {
  68. $args = wp_parse_args($args,
  69. 'id' => '',
  70. 'class' => '',
  71. 'title' => '',
  72. 'heading' => 'div',
  73. 'content' => '',
  74. )
  75. );
  76. extract($args);
  77. if (theme_is_empty_html($title) && theme_is_empty_html($content)) return;
  78. if ($id) {
  79. $id = ' id="' . $id . '"';
  80. }
  81. if ($class) {
  82. $class = ' ' . $class;
  83. }
  84. echo "<div class=\"wto-widget{$class}\"{$id}>";
  85. if ( !theme_is_empty_html($title)) echo '<'.$heading.' class="wto-widget-title">' . $title . '</'.$heading.'>';
  86. echo '<div class="wto-widget-content">' . $content . '</div>';
  87. echo '</div>';
  88. }
  89.  
  90. function theme_block_wrapper($args) {
  91. $args = wp_parse_args($args,
  92. 'id' => '',
  93. 'class' => '',
  94. 'title' => '',
  95. 'heading' => 'div',
  96. 'content' => '',
  97. )
  98. );
  99. extract($args);
  100. if (theme_is_empty_html($title) && theme_is_empty_html($content)) return;
  101. if ($id) {
  102. $id = ' id="' . $id . '"';
  103. }
  104. if ($class) {
  105. $class = ' ' . $class;
  106. }
  107.  
  108. $begin = <<<EOL
  109. <div class="wto-box wto-block{$class}"{$id}>
  110.   <div class="wto-box-body wto-block-body">
  111. EOL;
  112. $begin_title = <<<EOL
  113. <div class="wto-bar wto-blockheader">
  114.   <$heading class="t">
  115. EOL;
  116. $end_title = <<<EOL
  117. </$heading>
  118. </div>
  119. EOL;
  120. $begin_content = <<<EOL
  121. <div class="wto-box wto-blockcontent">
  122.   <div class="wto-box-body wto-blockcontent-body">
  123. EOL;
  124. $end_content = <<<EOL
  125. <div class="cleared"></div>
  126.   </div>
  127. </div>
  128. EOL;
  129. $end = <<<EOL
  130. <div class="cleared"></div>
  131.   </div>
  132. </div>
  133. EOL;
  134. echo $begin;
  135. if ($begin_title && $end_title && !theme_is_empty_html($title)) {
  136. echo $begin_title . $title . $end_title;
  137. }
  138. echo $begin_content;
  139. echo $content;
  140. echo $end_content;
  141. echo $end;
  142. }
  143.  
  144. function theme_vmenu_wrapper($args) {
  145. $args = wp_parse_args($args,
  146. 'id' => '',
  147. 'class' => '',
  148. 'title' => '',
  149. 'heading' => 'div',
  150. 'content' => '',
  151. )
  152. );
  153. extract($args);
  154. if (theme_is_empty_html($title) && theme_is_empty_html($content)) return;
  155. if ($id) {
  156. $id = ' id="' . $id . '"';
  157. }
  158. if ($class) {
  159. $class = ' ' . $class;
  160. }
  161.  
  162. $begin = <<<EOL
  163. <div class="wto-box wto-vmenublock{$class}"{$id}>
  164.   <div class="wto-box-body wto-vmenublock-body">
  165. EOL;
  166. $begin_title = <<<EOL
  167.  
  168. EOL;
  169. $end_title = <<<EOL
  170.  
  171. EOL;
  172. $begin_content = <<<EOL
  173. <div class="wto-box wto-vmenublockcontent">
  174.   <div class="wto-box-body wto-vmenublockcontent-body">
  175. EOL;
  176. $end_content = <<<EOL
  177. <div class="cleared"></div>
  178.   </div>
  179. </div>
  180. EOL;
  181. $end = <<<EOL
  182. <div class="cleared"></div>
  183.   </div>
  184. </div>
  185. EOL;
  186. echo $begin;
  187. if ($begin_title && $end_title && !theme_is_empty_html($title)) {
  188. echo $begin_title . $title . $end_title;
  189. }
  190. echo $begin_content;
  191. echo $content;
  192. echo $end_content;
  193. echo $end;
  194. }
  195. ?>