Osclass forums
Support forums => General help => 3.6.x => Topic started by: HimSelf on November 04, 2016, 01:27:52 am
-
Hello,
i'm trying to add the category description in my theme.
so i added <div><?php echo osc_item_category_description(); ?> </div>
in search.php and it works well.
Perhaps, i have some description that shows also on regular search pages.
how can i add something like "if(is_category()) { echo osc_item_category_description(); }"
( is_category(); ) is a wordpress function that helps to show some informations only if we are on a category page.
thanks a lot in advance for your help !
-
No idea ?
let me try to explain it differently :
i need a function or a code that can do this :
Am i on a category page ?
- yes : show category description
- no : show something else or nothing.
thanks a lot for your help
-
why no just use
if (osc_item_category_description()) { echo osc_item_category_description(); }
you can use too
if (osc_item_category()) { echo osc_item_category_description(); }
https://doc.osclass.org/HItems.php (https://doc.osclass.org/HItems.php)
-
thanks for you answear.
your idea seems good,
but it didnt work.
i still have category description displayed in search results.
i have tested your 2 examples, in my theme and in default osclass theme.
-
here is an example :
-http://www.brui**o.be/recherche/sKeyword,chambre
(replace ** by "mm") sorry but i dont want this results to show up in google ;-)
this page should return no description, but it shows the description from the category of the displayed 1st result !
this make troubles for my SEO.
how can i manage this ? Any idea is welcome
-
ideas are welcome !