Search code examples
htmlcssosclass

Osclass make content side by side with category


It's been days since I'm trying to modify my Osclass web.

I'm currently using Bender Black Theme and have made my Category in single cell, what I'm trying to do is put the "Latest Items" side by side with my Category exactly like Repurpose Theme below, since Black Bender put the Latest Items under the Category as default

enter image description here

What I have done is altered my Category and Latest Items css and add float:left to them, or position into relative.. but no works.

I've been searhing in osclass forum too.. and find this question How to Add Content Above Category list, Bender From the solution given, I've put some code to in my Header.php about in line 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 -->

But it ended up my Latest Items placed above the Category (just like the question was all about) and it actually made the Latest Items content appear in all pages,

From there I've been trying modify both my css and html code.. But no luck...

any suggestion ?? :)


Solution

  • Done O_o

    I make new css --> "newcss" following the body.home css like this

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

    Then I use the same code I provide before, put it within newcss div like this

    <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>
    

    I did the change in functions.php in the Black Bender theme within function bender_black_draw_categories_list(){ and before the draw category code , and revert my Header.php to its original ^_^ It's actually work

    enter image description here