• I am using wordpress theme which uses dropdown box for categories to show in featured slider due to which only one category at a time is selected. All i want to include all categories in featured slider.
    code is

    <select name=”cp_featuredCatID” class=”selectCat”>
    <?php $cats = get_categories(‘hide_empty=0’); foreach($cats as $cat) { ?>
    <option value=”<?php echo $cat->cat_ID; ?>”<?php selected($cat->cat_ID, $this->options[“featuredCatID”]); ?>><?php echo $cat->cat_name; ?></option>
    <?php } ?></select>

    My question is, how to change this dropdown box to text box to manually insert categories with th option to store values.

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter mari0

    (@mari0)

    Bump!

    Thread Starter mari0

    (@mari0)

    Anyone with solution!

    a wild guess, utterly untested:

    with ‘cat=0’ in a query, one would get posts of all cats;
    therefore try:

    <select name="cp_featuredCatID" class="selectCat">
    <?php $cats = get_categories('hide_empty=0');
    <option value="0"<?php selected(0, $this->options["featuredCatID"]); ?>><?php echo 'all'; ?></option>
    foreach($cats as $cat) { ?>
    <option value="<?php echo $cat->cat_ID; ?>"<?php selected($cat->cat_ID, $this->options["featuredCatID"]); ?>><?php echo $cat->cat_name; ?></option>
    <?php } ?></select>

    whether this works, depends on the code that is working with this selction …

    what is your theme?
    (if it is a free theme: name and download link?)

    Thread Starter mari0

    (@mari0)

    i got error with msg,
    Parse error: syntax error, unexpected ‘<‘

    There is something wrong with this line
    <option value=”0″<?php selected(0, $this->options[“featuredCatID”]); ?>>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘DropDown box for Categories’ is closed to new replies.