WordPress.org

Support

Support » Plugins and Hacks » Excluding categories from a menu

Excluding categories from a menu

  • hello!

    as you guys can see here: http://zyanclothing.com some categories are called and added to a menu on the header… I updated the plugin and suddenly the code that was before stopped working and now I can see all the categories

    This is the actual code that doesn’t works anymore:

    <?php wpsc_start_category_query(array(‘parent_category_id’=> 0, ‘show_thumbnails’=> false, ‘show_name’ => true, ‘exclude’ => array(’53’,’57’,’58’))); ?>

    Any idea on how to fix this?

    Thank you!

    Aldo

    https://wordpress.org/plugins/wp-e-commerce/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hola!

    I can see two horizontal menu bars.
    One begins with
    Best sellers 2012 Best sellers 2013 BEST SELLERS 2014
    the other with
    HOME ESTO ES ZYAN TIENDA
    The top one has all the submenus already dropped down in Firefox and Chrome. So it looks mostly like a layout issue to me. I am not sure which categories you do not want to see! but maybe this part:
    ‘exclude’ => array(’53’,’57’,’58’)));

    needs updating?

    Hi whitelamp, thank you for replying.

    Actually yes, that part needs updating but maybe it’s a syntax issue.

    As I said before, that line of code worked great before and categories 53,57 and 58 are the ones I want to exclude from that array.

    Bona nit,

    Which menu bar is it that is wrong?

    aldodager Did you find the solution to this?? The “exclude” part stopped working for me too…

    Manthy,

    Nope. I just removed some categories to patch things up. Stopped working when I updated WordPress and WP E-Commerce.

    Aldo

    That was my problem too.
    I thought of another way to achieve “not displaying specific product categories” in my product categories list.

    In case someone finds it usefull..

    I changed this (in wpsc-products_page.php, in my child theme):

    <a href="<?php wpsc_print_category_url();?>" class="wpsc_category_grid_item  <?php wpsc_print_category_classes_section(); ?>" title="<?php wpsc_print_category_name(); ?>">
    						<?php wpsc_print_category_image(get_option('category_image_width'),get_option('category_image_height')); ?>
    					</a>

    into this:

    <a href="<?php wpsc_print_category_url();?>" class="wpsc_category_grid_item  c<?php wpsc_print_category_id(); ?>" title="<?php wpsc_print_category_name(); ?>">
    						<?php wpsc_print_category_image(get_option('category_image_width'),get_option('category_image_height')); ?>
    					</a>

    Basically this makes it possible to give each “category” its own class.

    So then, in my css file, I created a class .c11 and .c12 (11 and 12 is the IDs of the product categories I needed to axclude) and I put in that classes display:none;.

    Not the right way maybe… but it gets the job done!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Excluding categories from a menu’ is closed to new replies.