wp_list_categories example

$parsed_args['orderby'] = $parsed_args['sort_column'];
    if ( isset($parsed_args['sort_order']) )
        $parsed_args['order'] = $parsed_args['sort_order'];
    if ( isset($parsed_args['optiondates']) )
        $parsed_args['show_last_update'] = $parsed_args['optiondates'];
    if ( isset($parsed_args['optioncount']) )
        $parsed_args['show_count'] = $parsed_args['optioncount'];
    if ( isset($parsed_args['list']) )
        $parsed_args['style'] = $parsed_args['list'] ? 'list' : 'break';
    $parsed_args['title_li'] = '';

    return wp_list_categories($parsed_args);
}

/** * Deprecated method for generating a drop-down of categories. * * @since 0.71 * @deprecated 2.1.0 Use wp_dropdown_categories() * @see wp_dropdown_categories() * * @param int $optionall * @param string $all * @param string $orderby * @param string $order * @param int $show_last_update * @param int $show_count * @param int $hide_empty * @param bool $optionnone * @param int $selected * @param int $exclude * @return string */
                $cat_args['title_li'] = '';

                /** * Filters the arguments for the Categories widget. * * @since 2.8.0 * @since 4.9.0 Added the `$instance` parameter. * * @param array $cat_args An array of Categories widget options. * @param array $instance Array of settings for the current widget. */
                wp_list_categories( apply_filters( 'widget_categories_args', $cat_args$instance ) );
                ?> </ul> <?php             if ( 'html5' === $format ) {
                echo '</nav>';
            }
        }

        echo $args['after_widget'];
    }

    
</ul> <ul role="navigation"> <?php wp_list_pages( 'title_li=<h2>' . __( 'Pages' ) . '</h2>' ); ?> <li><h2><?php _e( 'Archives' ); ?></h2> <ul> <?php wp_get_archives( array( 'type' => 'monthly' ) ); ?> </ul> </li> <?php                 wp_list_categories(
                    array(
                        'show_count' => 1,
                        'title_li'   => '<h2>' . __( 'Categories' ) . '</h2>',
                    )
                );
                ?> </ul> <ul> <?php if ( is_home() || is_page() ) { /* If this is the frontpage */ ?> <?php wp_list_bookmarks(); ?> <li><h2>
if ( ! is_admin() ) {
            // Inject the dropdown script immediately after the select dropdown.             $items_markup = preg_replace(
                '#(?<=</select>)#',
                build_dropdown_script_block_core_categories( $id ),
                $items_markup,
                1
            );
        }
    } else {
        $wrapper_markup = '<ul %1$s>%2$s</ul>';
        $items_markup   = wp_list_categories( $args );
        $type           = 'list';
    }

    $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => "wp-block-categories-{$type}) );

    return sprintf(
        $wrapper_markup,
        $wrapper_attributes,
        $items_markup
    );
}

Home | Imprint | This part of the site doesn't use cookies.