Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 134382

miguel84 on "Problems with wordpress wp_reset_query();"

$
0
0

I need a custom menu in WordPress so I installed a plugin to allow php code on widgets

my code is:

<div class="categories-header">
    <?php

        wp_reset_query();
        wp_list_categories('orderby=name&show_count=1&include=125&title_li=');

    ?>
</div>
<?php wp_list_categories('hide_empty=0&orderby=name&show_count=1&use_desc_for_title=0&child_of=125&title_li=' ); ?>

<div class="categories-header">
    <?php

        wp_reset_query();
        wp_list_categories('orderby=name&show_count=1&include=119&title_li=');

    ?>
</div>
<?php wp_list_categories('hide_empty=0&orderby=name&show_count=1&use_desc_for_title=0&child_of=119&title_li=' ); ?>

The first category retrieved by

wp_list_categories('orderby=name&show_count=1&include=125&title_li=');

works fine. For it to work i had to add wp_reset_query(); right before

but further down the code the line

wp_list_categories('orderby=name&show_count=1&include=119&title_li=');

retrives "no categories" although the code following it retrieves its child categories fine....

Any idea why?

The site is http://goo.gl/ehjVt and it's the left widget "SELLING"

[No bumping, thank you.]


Viewing all articles
Browse latest Browse all 134382

Trending Articles