PHP Code Optimization for Creating Div Structure: Closing Div Tag Placement
Based on the code provided, it seems that the issue lies in the placement of the closing div tags. Here is the corrected code:\n\nphp\nif ($query->have_posts()):\n $count_posts = $query->found_posts;\n\n while ($query->have_posts()) {\n $query->the_post();\n //qq_get_template_part('product', 'grid');\n }\n\n if($count_posts > $per_page):\n echo '</div></div></div>'; // Close the div tags here\n cj_paginator( $count_posts, $per_page, $paged );\n echo '<div><div><div>';\n endif;\n\nelse:\n?>\n \n<div class="qq100w qqinrow">\n <div class="noproduct">\n <span>متاسفیم! محصولی با فیلترهای مورد نظر شما موجود نیست.</span>\n </div>\n</div>\n\n<script>\n $('.qq_pr_count span').text('0');\n</script>\n<?php endif; ?>\n\n\nIn the corrected code, the closing div tags are placed right before the cj_paginator function call and after the endif statement. This should create the necessary div structure.
原文地址: https://www.cveoy.top/t/topic/qawK 著作权归作者所有。请勿转载和采集!