【问题标题】:Osclass make content side by side with categoryOsclass 使内容与类别并排
【发布时间】:2015-03-22 23:56:06
【问题描述】:

我已经好几天没有尝试修改我的 Osclass 网站了。

我目前正在使用 Bender Black Theme 并在单个单元格中创建了我的类别,我想做的是将“最新项目”与我的类别并排放置,就像下面的 Repurpose Theme 一样,因为 Black Bender将最新项目默认放在类别下

我所做的是更改了我的类别和最新项目 css 并添加 float:left 到它们,或定位到相对..但没有工作。

我也一直在 osclass 论坛中搜索.. 并找到这个问题 How to Add Content Above Category list, Bender 从给出的解决方案中,我在 Header.php 的第 92 行添加了一些代码

<div class="clear"></div>
<div class="latest_ads">
<h1><strong><?php _e('Latest Listings', 'bender_black') ; ?></strong></h1>
 <?php if( osc_count_latest_items() == 0) { ?>
    <div class="clear"></div>
    <p class="empty"><?php _e("No Listing", 'bender_black'); ?></p>
<?php } else { ?>
    <div class="actions">
      <span class="doublebutton <?php echo $buttonClass; ?>">
           <a href="<?php echo osc_base_url(true); ?>?sShowAs=list" class="list-button" data-class-toggle="listing-grid" data-destination="#listing-card-list"><span><?php _e('List', 'bender_black'); ?></span></a>
           <a href="<?php echo osc_base_url(true); ?>?sShowAs=gallery" class="grid-button" data-class-toggle="listing-grid" data-destination="#listing-card-list"><span><?php _e('Grid', 'bender_black'); ?></span></a>
      </span>
    </div>
    <?php
    View::newInstance()->_exportVariableToView("listType", 'latestItems');
    View::newInstance()->_exportVariableToView("listClass",$listClass);
    osc_current_web_theme_path('loop.php');
    ?>
    <div class="clear"></div>
    <?php if( osc_count_latest_items() == osc_max_latest_items() ) { ?>
        <p class="see_more_link"><a href="<?php echo osc_search_show_all_url() ; ?>">
            <strong><?php _e('See all listings', 'bender_black') ; ?> &raquo;</strong></a>
        </p>
    <?php } ?>
<?php } ?>
</div>
</div><!-- main -->

但它最终将我的最新项目放在类别上方(就像问题的全部内容一样),它实际上使最新项目内容出现在所有页面中,

从那里我一直在尝试修改我的 css 和 html 代码。但没有运气...

有什么建议吗?? :)

【问题讨论】:

    标签: html css osclass


    【解决方案1】:

    完成O_o

    我在 body.home css 之后创建新的 css --> "newcss" 像这样

    body.home #newcss {width:600px;float:right;margin:20px 0 0 0;}
    

    然后我使用我之前提供的相同代码,像这样将它放在 newcss div 中

    <div class="newcss">
    <h1><strong><?php _e('Latest Listings', 'bender_black') ; ?></strong></h1>
         <?php if( osc_count_latest_items() == 0) { ?>
            <div class="clear"></div>
    
        <p class="empty"><?php _e("No Listing", 'bender_black'); ?></p>
    <?php } else { ?>
        <div class="actions">
          <span class="doublebutton <?php echo $buttonClass; ?>">
               <a href="<?php echo osc_base_url(true); ?>
    ?sShowAs=list" class="list-button" data-class-toggle="listing-grid" data-destination="#listing-card-list">
    <span><?php _e('List', 'bender_black'); ?></span></a>
               <a href="<?php echo osc_base_url(true); ?>
    ?sShowAs=gallery" class="grid-button" data-class-toggle="listing-grid" data-destination="#listing-card-list">
    <span><?php _e('Grid', 'bender_black'); ?></span></a>
          </span>
        </div>
        <?php
        View::newInstance()->_exportVariableToView("listType", 'latestItems');
        View::newInstance()->_exportVariableToView("listClass",$listClass);
        osc_current_web_theme_path('loop.php');
        ?>
        <div class="clear"></div>
        <?php if( osc_count_latest_items() == osc_max_latest_items() ) { ?>
            <p class="see_more_link"><a href="<?php echo osc_search_show_all_url() ; ?>">
                <strong><?php _e('See all listings', 'bender_black') ; ?> &raquo;</strong></a>
            </p>
        <?php } ?>
    <?php } ?>
    </div>
    

    我在 function bender_black_draw_categories_list(){ 内和绘制类别代码之前的 Black Bender 主题中更改了 functions.php,并将我的 Header.php 恢复为原来的 ^_^ 确实有效

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-07
      • 1970-01-01
      • 1970-01-01
      • 2014-10-26
      • 1970-01-01
      相关资源
      最近更新 更多