Osclass Support Forums
Osclass theme support => Delta Osclass Theme => Topic started by: Smithtech on September 05, 2021, 01:11:54 AM
-
Hi,
Please, how do I display category descriptions on frond tend in Delta theme?
Surprisingly, my categories don't actually rank or show in search results as you will expect. I'm I correct? I have realised that category pages don't really have a fixed meta description. When I check, the category meta description takes the meta description of the latest listing. I have tried different Osclass SEO plugins but it doesn't seem to be improving.
I want to display the category description in front so that at least I have a fix text that will be showing for meta description so that my category pages can stand a chance to show in Google search results.
Thank you
-
Simply place osc_category_description() function into search.php
-
Simply place osc_category_description() function into search.php
I added the code but nothing is showing on front end.
-
There are several options:
- category description is empty (or empty in your locale)
- no category is selected on search
- you did it incorrectly (<?php echo osc_category_description(); ?>)
-
There are several options:
- category description is empty (or empty in your locale): Category description is not empty. (I am not sure what you mean by or it is empty in your locale)
- no category is selected on search: Category was selected alright
- you did it incorrectly (<?php echo osc_category_description(); ?>): I added this alright and copied this right now and it didn't work
Please, this doesn't work for me still
There are several options:
- category description is empty (or empty in your locale): Category description is not empty. (I am not sure what you mean by or it is empty in your locale)
- no category is selected on search: Category was selected alright
- you did it incorrectly (<?php echo osc_category_description(); ?>): I added this alright and copied this right now and it didn't work
-
Ok then I think we have incorrect function.
https://docs.osclasspoint.com/hsearch-php
osc_search_category()
This will be object and I am not sure under which key description is, you must print it and try, but I guess 's_description' could work
-
I have tried several of them but they didn't work
osc_search_category()
osc_search_category(s_description)
This one prints the text Array
osc_category_description($locale = “”)
osc_category_field( 's_description' , $locale)
I checked here as well https://docs.osclasspoint.com/hcategories-php (https://docs.osclasspoint.com/hcategories-php)
-
This code solved the issue
<?php $cat = Category::newInstance()->findByPrimaryKey($search_cat_id);
echo @$cat['s_description']; ?>
I got it from this post https://forums.osclasspoint.com/starter-osclass-premium-theme/category-description-4739/ (https://forums.osclasspoint.com/starter-osclass-premium-theme/category-description-4739/)
-
@support
Nice, this one could work as well:
@osc_search_category()['s_description']