2 posts
  • Has been part of the Envato Community for over 1 year
  • Has collected 1+ items on Envato Market
cpendas says

Hi, A friend of mine set up a wordpress website for me, I know very little about how it works but now Im trying to modify and tweak the template to better suit my needs, since my friend did this as a favor I don’t like to bother him unless its really necessary, plus , I have enjoyed playing around and learning about wordpress.

Here’s the issue:

I want to exclude a category from the Index.php I have tried many different methods, bot for index and functions.php and its not working.

You can see the website here: http://tumbili.mx/p/marcas/ The second category, the one without image is the one I want to exclude. However I need it to be alive since it should be accessible from: http://tumbili.mx/p/categorias/

Here is the Index.php code, It does not look like other Index I have seen, maybe is not the right way to do it but it works :

<?php get_header(); ?> <div class="wrapper"> <div class="container_16"> <ul> <?php foreach (get_categories( $args ) as $cat): if ($cat->parent > 0) { continue; } ?> <li> <div class="container_4"> <a href="<?php echo get_category_link($cat->term_id); ?>"> <img class="img-object" src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" /> <!-- <?php echo $cat->cat_name; ?> --> </a> </div> </li> <?php endforeach; ?> </ul> </div> <div class="push" /> </div>

Hope you can help me, thanks

800 posts
  • Has been part of the Envato Community for over 6 years
  • Has been a beta tester for an Envato feature
  • Located in India
  • Sells items exclusively on Envato Market
+1 more
laranz says

Refer this: http://codex.wordpress.org/Function_Reference/get_categories

there is a exclude parameter for get_categories.

2 posts
  • Has been part of the Envato Community for over 1 year
  • Has collected 1+ items on Envato Market
cpendas says

Worked, now the solution seemed so simple :)

Thanks

by
by
by
by
by
by