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

810 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

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