duangouyan3328 2016-07-01 12:09
浏览 16

产品描述的评审部分

Trying to split the review section of my Product Description into 2 columns. It is nested just below the Product Description. The actual reviews in one column and the Add Review form in another column along side it.

Site is Wordpress with Woocommerce. To date I have moved the Reviews out of the Tabs and just below the Product Description. Look here https://www.boatpartsforless.com/shop/marpac-fuelwater-separator-filter-7-0860/. So that the page is not so long and I feel looks better in the Reviews I would like to display as mentioned above in Columns.

I came across the code for creating columns php

<?php
function my_multi_col($content) {

$columns = explode('<h2>', $content);
$i = 0;

foreach ($columns as $column) {
    if (($i % 2) == 0) {
        $return .= '<div class="content_left">'."
";
        if ($i > 1) {
            $return .= "<h2>";
        } else {
            $return .= '<div class="content_right">'."
 <h2>";
        }
        $return .= $column;
        $return .= '</p></div>';
        $i++;
    }
    if(isset($columns[1])) {
            $content = wpautop($return);
    } else {
            $content = wpautop($content);
    }
    echo $content;
}
}
add_filter('the_content', 'my_multi_col');
?>

I believe adding it to the single-product-reviews.php file will do the trick, just can't figure out what to replace the h2's with.

Or, a way that makes sense if I am completely off base here.

Any push in the right direction will be much appreciated.

  • 写回答

1条回答 默认 最新

  • duanmeng7865 2016-07-04 13:41
    关注

    Figured it out. Was making it way to difficult. Did it with CSS in Style Sheet.

    /* Reviews In Columns */
    
    #reviews #comments ol.commentlist {
    float: right !important;
    width: 60% !important;
    }
    
    #reviews #review_form_wrapper {
    margin-top: 0 !important;
    float: left !important;
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程