Advertisement:

Author Topic: Main Page categories column problems.  (Read 2561 times)

adurls

  • Newbie
  • *
  • Posts: 18
Main Page categories column problems.
« on: February 12, 2012, 01:18:42 pm »
I am using Modern theme and i wanted to display 4 column categories. so how can i do this.

I am show you here our website. I hope you will understand what i want to say. give me the best solutions. thanks

http://www.businesslisted.in/



adurls

  • Newbie
  • *
  • Posts: 18
Re: Main Page categories column problems.
« Reply #1 on: February 12, 2012, 11:20:44 pm »
No one have the solution? please help on this topic.  :(

shree

  • Full Member
  • ***
  • Posts: 209
Re: Main Page categories column problems.
« Reply #2 on: May 30, 2012, 11:37:49 am »
me want too

navjottomer

  • Tutor
  • Sr. Member
  • *
  • Posts: 378
  • I am here
Re: Main Page categories column problems.
« Reply #3 on: June 05, 2012, 06:43:53 am »
This one can help
Code: [Select]
<div class="content home">
                <div id="main"  >
                               
                    <?php
                        $total_categories   
osc_count_categories() ;
                        
$col1_max_cat       ceil($total_categories/4);
                        
$col2_max_cat       ceil(($total_categories-$col1_max_cat)/3);
                        
$col3_max_cat       ceil(($total_categories-$col1_max_cat-$col2_max_cat)/2);
                        
$col4_max_cat       $total_categories-($col1_max_cat+$col2_max_cat+$col3_max_cat);
                    
?>

                    <div class="categories <?php echo 'c' $total_categories ?>">
                        <?php osc_goto_first_category() ; ?>
                        <?php
                            $i      
1;
                            
$x      1;
                            
$col    1;
                            if(
osc_count_categories () > 0) {
                                echo 
'<div class="col c1">';
                            }
                        
?>

                        <?php while ( osc_has_categories() ) { ?>
                            <div class="category">
                                <span id="<?php echo osc_category_slug() ; ?>"></span><h1><strong><a href="<?php echo osc_search_category_url() ; ?>"><?php echo osc_category_name() ; ?></a> </strong></h1>
                                <?php if ( osc_count_subcategories() > ) { ?>
                                    <ul>
                                        <?php while ( osc_has_subcategories() ) { ?>
                                            <li><a class="category <?php echo osc_category_slug() ; ?>" href="<?php echo osc_search_category_url() ; ?>"><?php echo osc_category_name() ; ?></a> </li>
                                        <?php ?>
                                    </ul>
                                <?php ?>
                            </div>
                            <?php
                                
if (($col==&& $i==$col1_max_cat) || ($col==&& $i==$col2_max_cat) || ($col==&& $i==$col3_max_cat) || ($col==&& $i==$col4_max_cat)){
                                    
$i 1;
                                    
$col++;
                                    echo 
'</div>';
                                    if(
$x $total_categories) {
                                        echo 
'<div class="col c'.$col.'">';
                                    }
                                } else {
                                    
$i++ ;
                                }
                                
$x++ ;
                            
?>

                        <?php ?>
                   </div>