Support Forums - Classified Ads Script Osclass

Osclass theme support => Starter Osclass Premium Theme => Topic started by: Sergio1 on April 19, 2020, 12:02:06 PM

Title: Category description
Post by: Sergio1 on April 19, 2020, 12:02:06 PM
Hello,

I need to include the category description on the category page on the front.
I have modified the following code in search.php, but it doesn't work ...

Can you help me?

Thanks!

Code: [Select]
<!-- HELPERS FORS AJAX SEARCH -->
<div id="ajax-help" style="display:none;">
<input type="hidden" name="ajax-last-page-id" value="<?php echo ceilosc_search_total_items() / osc_default_results_per_page_at_search() ); ?>" />
<?php
$search_cat_id 
osc_search_category_id();
$search_cat_id = isset($search_cat_id[0]) ? $search_cat_id[0] : '';
?>

</div>
<p><?php echo osc_search_category()['s_description']; ?></p>
<div id="search-items" data-loading="<?php _e('Loading listings...''starter'); ?>">
<?php if(osc_count_items() == 0) { ?>
<div class="list-empty round3" >
<img src="<?php echo osc_current_web_theme_url('images/search-empty.png'); ?>"/>
<div>
Title: Re: Category description
Post by: MB Themes on April 20, 2020, 08:17:43 AM
@Sergio1
Try:
Code: [Select]
$cat = Category::newInstance()->findByPrimaryKey($search_cat_id);
echo @$cat['s_description']


Title: Re: Category description
Post by: Sergio1 on April 20, 2020, 08:41:19 PM
Thank you @MB Themes!!

Now is working!