• This is my code:

    <?php
    $args = array(
    ‘show_option_all’ => ”,
    ‘orderby’ => ‘name’,
    ‘order’ => ‘ASC’,
    ‘show_last_update’ => 0,
    ‘style’ => ‘list’,
    ‘show_count’ => 0,
    ‘hide_empty’ => 1,
    ‘use_desc_for_title’ => 1,
    ‘child_of’ => 0,
    ‘feed’ => ”,
    ‘feed_type’ => ”,
    ‘feed_image’ => ”,
    ‘exclude’ => ”,
    ‘exclude_tree’ => ”,
    ‘include’ => ”,
    ‘hierarchical’ => true,
    ‘title_li’ => __( ‘Categories’ ),
    ‘number’ => NULL,
    ‘echo’ => 1,
    ‘depth’ => 0,
    ‘current_category’ => 0,
    ‘pad_counts’ => 0,
    ‘taxonomy’ => ‘category’,
    ‘walker’ => ‘Walker_Category’ );
    ?>
    <?php wp_list_pages($args); ?>

    And I’m getting this error from it:

    Fatal error: Using $this when not in object context in C:\wamp\www\lessons\wp-includes\classes.php on line 912

    Any ideas why? :<

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter dexteremmerich

    (@dexteremmerich)

    *bump*

    B.

    (@bandonrandon)

    There is no reason to create an $args variable you want to do something like <?php wp_list_pages('orderby=name&order=ASC'); ?> You only want to pass the arguments you are changing from the default into wp_list_pages.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error when passing $args to wp_list_pages()’ is closed to new replies.