×

php up to date

Os Class Home Page Customization

Os Class Theme Home Page Customization



output:


If you try to get like this output follow the below steps(Bender theme)


Go to functions.php and edit these line
Step 1:

      Remove Subcategory from os class

       Find  <?php if ( osc_count_subcategories() > 0 ) { ?> these code in the functions .php file and remove those section.

Step2: 

      Apply images for category

In functions .php find category section and replace with in the h1 tag with below code.
<h1>
                    <?php
                    $_slug      = osc_category_slug();
                    $_url       = osc_search_category_url();
                    $_name      = osc_category_name();
                    $_total_items = osc_category_total_items();
                    if ( osc_count_subcategories() > 0 ) { ?>
                    <span class="collapse resp-toogle"><i class="fa fa-caret-right fa-lg"></i></span>
                    <?php } ?>
                    <?php if($_total_items > 0) { ?>
                   
<img src="<?php echo osc_current_web_theme_url()?>/images/<?php echo $_slug; ?>.png">
<a class="category <?php echo $_slug; ?>" href="<?php echo $_url; ?>">   
   <?php echo $_name ; ?></a> <span>(<?php echo $_total_items ; ?>)</span>
                    <?php } else { ?>
                   
<img src="<?php echo osc_current_web_theme_url()?>/images/<?php echo $_slug; ?>.png">
<a class="category <?php echo $_slug; ?>" href="#">
<?php echo $_name ; ?></a> <span>(<?php echo $_total_items ; ?>)</span>
                    <?php } ?>
                 </h1>

Save images in the image folder. The image name should be like category names. ex: if category name is realestate the image name should be real-estate.png.

for demo visit www.adpalani.com/classifieds

SHARE

blogger

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment

Thanks for your valuable feedback