Osclass forums

Support forums => Themes => Bender => Topic started by: rainilson on May 26, 2018, 06:09:07 am

Title: placing category horizontally [ SOLVED ]
Post by: rainilson on May 26, 2018, 06:09:07 am
hello dear friends. I need help, I want the bender theme category horizontally, I want to change it, place the category just below the blue area of the head. Could some friend help me?

I want to make it look like the one in the photo.
Title: Re: placing category horizontally
Post by: rainilson on May 27, 2018, 02:28:59 am
Could some friend help me, please?  :'( :'( :'(
Title: Re: placing category horizontally
Post by: Resta on May 27, 2018, 08:27:24 am
Hi,

You want just those category icons linking to each category?  Do you already have those individual icons shown in the uploaded image? If so, one thing you can do is to delete the part of the code in main.php that shows categories (just above Latest Listings) and then hand code and link each image to the corresponding category like <a href="category_name"><img src="myimage"></a> and upload main.php - make a backup copy. For this you need to know basic html and php and if not, then your best bet is to hire someone who can customize your theme because if you do not know html or php then you will run into other issues later.
Title: Re: placing category horizontally
Post by: rainilson on May 27, 2018, 05:31:29 pm
Hello dear friend, thank you for your answers, I do not want just for the pictures, I want to by the horizontal category, the pictures in the category, I already know how to put.


Hi,

You want just those category icons linking to each category?  Do you already have those individual icons shown in the uploaded image? If so, one thing you can do is to delete the part of the code in main.php that shows categories (just above Latest Listings) and then hand code and link each image to the corresponding category like <a href="category_name"><img src="myimage"></a> and upload main.php - make a backup copy. For this you need to know basic html and php and if not, then your best bet is to hire someone who can customize your theme because if you do not know html or php then you will run into other issues later.
Title: Re: placing category horizontally
Post by: WEBmods on May 27, 2018, 05:48:28 pm
Hello,

You can post your functions.php and your page's URL and I will see what I can do to help you when I will have some time.
If you want this to be done faster and maybe even better, consider posting it into Jobs section, but then you will need to pay of course.

Regards.
Title: Re: placing category horizontally
Post by: rainilson on May 27, 2018, 07:04:38 pm
Hello,

You can post your functions.php and your page's URL and I will see what I can do to help you when I will have some time.
If you want this to be done faster and maybe even better, consider posting it into Jobs section, but then you will need to pay of course.

Regards.

Hello dear friend, thank you very much for your response, it is the basic theme of bender, I just want the category, horizontally, same as the image I posted, the images of this category I know how to do, I do not know under the heading and in the horizontal. thank you friend
Title: Re: placing category horizontally
Post by: rainilson on May 30, 2018, 01:46:34 am
Can someone help me please ?
Title: Re: placing category horizontally
Post by: tito on May 30, 2018, 02:46:29 am
4 times ask for help in 1 dat=y would not help you i guess
Title: Re: placing category horizontally
Post by: rainilson on May 31, 2018, 06:35:02 am
4 times ask for help in 1 dat=y would not help you i guess



ok friend, sorry, I did not know you were not allowed to ask for help 4 times in the day! >:(
Title: Re: placing category horizontally
Post by: tito on May 31, 2018, 06:55:49 am
good to see you show respect and show that you read the forum rules
Title: Re: placing category horizontally
Post by: rainilson on May 31, 2018, 06:52:37 pm
good to see you show respect and show that you read the forum rules

Dear friend, if you do not intend to help, please do not comment anything ok, thank you.
Title: Re: placing category horizontally
Post by: tito on May 31, 2018, 07:00:09 pm
if you dont follow normal rules i am free to comment this
Title: Re: placing category horizontally
Post by: WEBmods on May 31, 2018, 10:06:21 pm
Please don't spam. If someone wants to help, it will. Bumping threads won't help you. Please give me your website URL if you want me to see, as you said you added icons.

Regards.
Title: Re: placing category horizontally
Post by: rainilson on June 01, 2018, 05:35:40 am
Please don't spam. If someone wants to help, it will. Bumping threads won't help you. Please give me your website URL if you want me to see, as you said you added icons.

Regards.

Hi, my dear friend, thank you very much for your response. so I've made some changes, I'll give you the link to the thema test

http://teste.upclassificados.com.br/

as I mentioned friend, I wanted the categories just below the header
Title: Re: placing category horizontally
Post by: WEBmods on June 01, 2018, 03:04:09 pm
Okay, if you want something like the picture below, post your functions.php.

(https://s15.postimg.cc/ft1jlm8uz/example.png)

Regards.
Title: Re: placing category horizontally
Post by: rainilson on June 01, 2018, 05:05:43 pm

dear friend, I really liked it that way too, how would you show me the way you did, over the blue background, and another blue background, please, how did you do it? explain to me how it was done, so I can learn, please

friend, I do not know how to post the file function.php, in case it is otherwise please tell me



Title: Re: placing category horizontally
Post by: WEBmods on June 01, 2018, 06:22:56 pm
To make the categories horizontal, replace this:

Code: [Select]
<?php
if (!function_exists('bender_draw_categories_list')) {

    function 
bender_draw_categories_list() {
        
?>

                    <?php if (!osc_is_home_page()) {
                        echo 
'<div class="resp-wrapper">';
                    } 
?>

                   
<?php osc_current_web_theme_path('map.php') ; ?>
                    <?php
                    
//cell_3
                    
$total_categories osc_count_categories();
                    
$col1_max_cat ceil($total_categories 3);

                    
osc_goto_first_category();
                    
$i 0;

                    while (
osc_has_categories()) {
                        
?>

                            <?php
                            
if ($i $col1_max_cat == 0) {
                                if (
$i 0) {
                                    echo 
'</div>';
                                }
                                if (
$i == 0) {
                                    echo 
'<div class="cell_3 first_cel">';
                                } else {
                                    echo 
'<div class="cell_3">';
                                }
                            }
                            
?>

            <ul class="r-list">
                <li>
                    <h1>
                    <br>
<?php //added by me - category icon ?>
                        <?php if(get_category_icon(osc_category_id())) { ?>
                        <img src="<?php echo get_category_icon(osc_category_id()); ?>" />
                        <?php ?>
                    <?php //added by me - category icon ?>
                    <br/>
            <?php
            $_slug 
osc_category_slug();
            
$_url osc_search_category_url();
            
$_name osc_category_name();
            
$_total_items osc_category_total_items();
             {
                
?>

                            <span class="collapse resp-toogle"><i class="fa fa-caret-right fa-lg"></i></span>
            <?php ?>
            <?php if ($_total_items 0) { ?>
                            <a class="category <?php echo $_slug?>" href="<?php echo $_url?>"><?php echo $_name?></a> <span></span>
            <?php } else { ?>
                            <a class="category <?php echo $_slug?>" href="#"><?php echo $_name?></a> <span></span>
            <?php ?>
                    </h1>
            <?php if (osc_count_subcategories() > 0) { ?>
                        <ul>
                <?php while (osc_has_subcategories()) { ?>
                                <li>
                    <?php if (osc_category_total_items() > 0) { ?>
                                         <span></span>
                    <?php } else { ?>
                                        </a> <span></span>
                    <?php ?>
                                </li>
                <?php ?>
                        </ul>
            <?php ?>
                </li>
            </ul>
            <?php
            $i
++;
        }
        echo 
'</div>';
        
?>

        <?php if (!osc_is_home_page()) {
            echo 
'</div>';
        } 
?>

        <?php
    
}

}

With this:

Code: [Select]
<?php
if (!function_exists('bender_draw_categories_list')) {

    function 
bender_draw_categories_list($show_map 1) {
        if (!
osc_is_home_page()) {
            echo 
'<div class="resp-wrapper">';
        }
        
        if(
$show_map)
            
osc_current_web_theme_path('map.php') ;

        
osc_goto_first_category();
        
$i 0;
        
?>

        <div style="width: 100%;">
            <ul class="r-list" style="margin: 0 auto;">
                <?php
                
while (osc_has_categories()) {
                
?>

                   
                <li style="display: inline-block;">
                    <h1 style="margin: 5px;">
                        <?php //added by me - category icon ?>
                        <?php if(get_category_icon(osc_category_id())) { ?>
                        <img src="<?php echo get_category_icon(osc_category_id()); ?>" />
                        <?php ?>
                        <?php //added by me - category icon ?>
                        <br>
                        <?php
                        $_slug 
osc_category_slug();
                        
$_url osc_search_category_url();
                        
$_name osc_category_name();
                        
$_total_items osc_category_total_items();
                        if (
$_total_items 0) { ?>

                                        <a class="category <?php echo $_slug?>" href="<?php echo $_url?>"><?php echo $_name?></a> <span></span>
                        <?php } else { ?>
                                        <a class="category <?php echo $_slug?>" href="#"><?php echo $_name?></a> <span></span>
                        <?php ?>
                    </h1>
                </li>
                <?php ?>
            </ul>
            <?php
            $i
++;
        
?>

        </div>
        <?php if (!osc_is_home_page()) {
            echo 
'</div>';
        } 
?>

        <?php
    
}

}
?>


To add categories to the blue background, you would need to find this code in header.php

Code: [Select]
</div>
<?php osc_show_widgets('header'); ?>

and replace it with

Code: [Select]
<?php bender_draw_categories_list(0); ?>
</div>
<?php osc_show_widgets('header'); ?>

Hope it will work.

Regards.
Title: Re: placing category horizontally
Post by: rainilson on June 02, 2018, 12:23:07 am
I will do the test and return, with the answer, thank you very much for your help, dear friend
Title: Re: placing category horizontally
Post by: rainilson on June 02, 2018, 01:11:50 am
To make the categories horizontal, replace this:

Code: [Select]
<?php
if (!function_exists('bender_draw_categories_list')) {

    function 
bender_draw_categories_list() {
        
?>

                    <?php if (!osc_is_home_page()) {
                        echo 
'<div class="resp-wrapper">';
                    } 
?>

                   
<?php osc_current_web_theme_path('map.php') ; ?>
                    <?php
                    
//cell_3
                    
$total_categories osc_count_categories();
                    
$col1_max_cat ceil($total_categories 3);

                    
osc_goto_first_category();
                    
$i 0;

                    while (
osc_has_categories()) {
                        
?>

                            <?php
                            
if ($i $col1_max_cat == 0) {
                                if (
$i 0) {
                                    echo 
'</div>';
                                }
                                if (
$i == 0) {
                                    echo 
'<div class="cell_3 first_cel">';
                                } else {
                                    echo 
'<div class="cell_3">';
                                }
                            }
                            
?>

            <ul class="r-list">
                <li>
                    <h1>
                    <br>
<?php //added by me - category icon ?>
                        <?php if(get_category_icon(osc_category_id())) { ?>
                        <img src="<?php echo get_category_icon(osc_category_id()); ?>" />
                        <?php ?>
                    <?php //added by me - category icon ?>
                    <br/>
            <?php
            $_slug 
osc_category_slug();
            
$_url osc_search_category_url();
            
$_name osc_category_name();
            
$_total_items osc_category_total_items();
             {
                
?>

                            <span class="collapse resp-toogle"><i class="fa fa-caret-right fa-lg"></i></span>
            <?php ?>
            <?php if ($_total_items 0) { ?>
                            <a class="category <?php echo $_slug?>" href="<?php echo $_url?>"><?php echo $_name?></a> <span></span>
            <?php } else { ?>
                            <a class="category <?php echo $_slug?>" href="#"><?php echo $_name?></a> <span></span>
            <?php ?>
                    </h1>
            <?php if (osc_count_subcategories() > 0) { ?>
                        <ul>
                <?php while (osc_has_subcategories()) { ?>
                                <li>
                    <?php if (osc_category_total_items() > 0) { ?>
                                         <span></span>
                    <?php } else { ?>
                                        </a> <span></span>
                    <?php ?>
                                </li>
                <?php ?>
                        </ul>
            <?php ?>
                </li>
            </ul>
            <?php
            $i
++;
        }
        echo 
'</div>';
        
?>

        <?php if (!osc_is_home_page()) {
            echo 
'</div>';
        } 
?>

        <?php
    
}

}

With this:

Code: [Select]
<?php
if (!function_exists('bender_draw_categories_list')) {

    function 
bender_draw_categories_list($show_map 1) {
        if (!
osc_is_home_page()) {
            echo 
'<div class="resp-wrapper">';
        }
        
        if(
$show_map)
            
osc_current_web_theme_path('map.php') ;

        
osc_goto_first_category();
        
$i 0;
        
?>

        <div style="width: 100%;">
            <ul class="r-list" style="margin: 0 auto;">
                <?php
                
while (osc_has_categories()) {
                
?>

                   
                <li style="display: inline-block;">
                    <h1 style="margin: 5px;">
                        <?php //added by me - category icon ?>
                        <?php if(get_category_icon(osc_category_id())) { ?>
                        <img src="<?php echo get_category_icon(osc_category_id()); ?>" />
                        <?php ?>
                        <?php //added by me - category icon ?>
                        <br>
                        <?php
                        $_slug 
osc_category_slug();
                        
$_url osc_search_category_url();
                        
$_name osc_category_name();
                        
$_total_items osc_category_total_items();
                        if (
$_total_items 0) { ?>

                                        <a class="category <?php echo $_slug?>" href="<?php echo $_url?>"><?php echo $_name?></a> <span></span>
                        <?php } else { ?>
                                        <a class="category <?php echo $_slug?>" href="#"><?php echo $_name?></a> <span></span>
                        <?php ?>
                    </h1>
                </li>
                <?php ?>
            </ul>
            <?php
            $i
++;
        
?>

        </div>
        <?php if (!osc_is_home_page()) {
            echo 
'</div>';
        } 
?>

        <?php
    
}

}
?>


To add categories to the blue background, you would need to find this code in header.php

Code: [Select]
</div>
<?php osc_show_widgets('header'); ?>

and replace it with

Code: [Select]
<?php bender_draw_categories_list(0); ?>
</div>
<?php osc_show_widgets('header'); ?>

Hope it will work.

Regards.

friend I put where I wanted it, it was perfect, but it is appearing above and abjection of the map, I just want it to appear above.
how should I do ?
Title: Re: placing category horizontally
Post by: rainilson on June 02, 2018, 04:53:05 pm
I have managed to resolve it, Mr PatrickFromCroatia, thank you very much for your help, you are a great man. thank you so much .
Title: Re: placing category horizontally
Post by: WEBmods on June 02, 2018, 06:06:48 pm
No problem. Please add "SOLVED" to the title of the topic by editing the first post.

Regards.