Osclass tutorials

..having problems with osclass? Find your answer here…

How to improve meta description for Public profiles? — March 4, 2016

How to improve meta description for Public profiles?

By default, user public profile has no meta description, which is not ideal for search engines.

So, to get meta description requires modification of one core file. (as always make backup before modifying any core file!)

Find: oc-includes/osclass/functions.php

where you find function meta_description( ) { in row 194

below which are functions for home page, static, search, listing.

Add the following somewhere in between these.

if ( osc_is_public_profile() ) {
$text = osc_user_info();
}

This will make user description a meta description tag.

EDIT:
Since search engines have 160 character limit on descriptions, it’s useful to limit this function:

if ( osc_is_public_profile() ) {
$text = osc_highlight(osc_user_info(), 160, ”, ”);
}

Best keyword Google rank checker — December 1, 2015
Osclass robots.txt for better indexing — August 26, 2015

Osclass robots.txt for better indexing

To avoid Google indexing non relevant pages, duplicates and similar, make robots.txt and upload it to root with the following:

User-agent: *
Disallow: /oc-admin/
Disallow: /cgi-bin/
Disallow: /*oc-admin
Disallow: /*printpdf
Disallow: /*print_ad
Disallow: /*sPattern
Disallow: /*sCategory
Disallow: /*sRegion
Disallow: /*sPriceMin
Disallow: /*sPriceMax
Disallow: /*buysell_type
Disallow: /*sOrder
Disallow: /*iOrderType
Disallow: /*search
Disallow: /*sPriceMax
Disallow: /*buysell_type
Disallow: /*sOrder
Disallow: /*iOrderType
Disallow: /*search

Solution for 404 http header on empty categories/locations — August 19, 2015
How to make RSS feed of your category? —
Display a certain element only on some categories —

Display a certain element only on some categories

To display an element only on one category, like an iframe or banner or something, you need following code.

<?php if(osc_category_slug() == "slugname") { ?>
                    code to display
         <?php } else { ?>
code else
                     <?php } ?>

To display on more categories just add in first row   php operator or (||):

if(osc_category_slug() == "slugname" || osc_category_slug() == "slugname")
Item price freeze error —
Change category and subcategory underscore to hyphen —

Change category and subcategory underscore to hyphen

Osclass by default uses underscores in categories and subcategories, which are not good for SEO purposes, as we know that words connected with underscore are treated as one word, while with hyphen there are separated.

So for example we have subcategories Shoes in categories Men and Women.

Men – Shoes  which url looks like domain.com/men/shoes

Women – Shoes which url looks like domain.com/women/shoes_1
(because there are two subcategories shoes, this one gets _1 so they are different.

Now Google sees the second one as Shoes1, which isn’t quite good keyword.

So to change these underscores to hyphen, you need to go to your osclass database and run SQL query with following:

UPDATE oc_t_category_description
SET s_slug = REPLACE(s_slug, '_', '-')

And that’s it. All categories and subcategories have now hyphens in between.

Limit sidebar countries —

Limit sidebar countries

If your theme has country list in main sidebar and you don’t want this list to be long, you can always limit it. For example, if you want to place banners underneath this list, you can limit it to 10 countries by changing main.php as stated below. If you want 20 countries, just change it to $i<20.

<?php if(osc_count_list_countries() > 0 ) { ?>
        
           

           
                               
  • "> ()
  •                        
       
        <?php } ?>

TO

<?php $i=0; if(osc_count_list_countries() > 0 ) { ?>
        
           

           
                               
  • "> ()
  •                        
       
        <?php } ?>
Welcome to Osclass Tutorials! —