963 posts
  • Has been part of the Envato Community for over 6 years
  • Has sold $10,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
EireStudio says

I have listed the categories and when I tick them, they update in the database correctly, but how do I output a ticked category ? :S

<p class="select clearfix">
      <label>Checkbox Category</label>
      <?php $categories = get_categories(); 
      foreach($categories as $category){ ?>
            <span><?php echo $category?>cat_name; ?></span>
            <input name="eirepanel_general_options_checkbox[]" type="checkbox" value="<?php echo $category?>cat_ID; ?>" 
                  <?php if ($eirepanel_general_options['checkbox'] == $category?>cat_ID) { echo 'checked'; } ?> 
            />
      <?php } ?> 
</p>
3007 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+7 more
duotive says

had the same problem. :) add the categories in a string like 1,34,5,6 save them, and when you get the saved string from the meta, explode it in an array and search for the searched category with in_array :D

963 posts
  • Has been part of the Envato Community for over 6 years
  • Has sold $10,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
EireStudio says

had the same problem. :) add the categories in a string like 1,34,5,6 save them, and when you get the saved string from the meta, explode it in an array and search for the searched category with in_array :D

Thanks mate.

Finally did it!!!!!! I am saving my entire theme options in a single array and I had the hardest time figuring it out, but I just got it to work, am so happy!!! :D :P

1148 posts
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
fillerspace says

I am saving my entire theme options in a single array and I had the hardest time figuring it out

That’s what I’m doing in my theme (actually separate arrays for colors, fonts, etc). It makes it easy to do things like export everything to xml or convert to json to use in javascript.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by