*

Romeo

  • ****
  • 115 posts
Category if
« on: August 09, 2017, 09:37:06 PM »
Hello, a little help if someone is available, I want to make a small script about the categories so:  how is it correct?

 <?php if(category(1) ) { ?>
        aaaaaaa
<?php else if(category(2) ) { ?>
       bbbbbbb
<?php else if(category(2) ) { ?>
       ccccccccc
      <?php } ?>

how is it correct? Any idea?

*

MB Themes

Re: Category if
« Reply #1 on: August 09, 2017, 10:24:45 PM »
@Romeo

This should give you category ID on search page
Code: [Select]
<?php
  $category 
osc_search_category_id();
  
$category_id $category[0];
?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Romeo

  • ****
  • 115 posts
Re: Category if
« Reply #2 on: August 10, 2017, 09:21:16 PM »
Where should I put the category id ?

*

MB Themes

Re: Category if
« Reply #3 on: August 11, 2017, 12:07:28 AM »
Before your code and change if conditions to category_id == 1 ...
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Romeo

  • ****
  • 115 posts
Re: Category if
« Reply #4 on: August 11, 2017, 09:03:15 PM »
I do not understand, how to change them?

*

MB Themes

Re: Category if
« Reply #5 on: August 11, 2017, 11:23:09 PM »
Code: [Select]
<?php
  $category 
osc_search_category_id();
  
$category_id $category[0];
?>


<?php if($category_id == 1) { ?>
        aaaaaaa
<?php else if($category_id == ) { ?>
       bbbbbbb
<?php else if($category_id == 3) { ?>
       ccccccccc
<?php ?>

Please read at least PHP basics before coding something ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots