WordPress.org

Ready to get started?Download WordPress

Forums

Display list of categories on archives page from category intersection??? (4 posts)

  1. millett513
    Member
    Posted 1 year ago #

    Hello,

    I am trying to find out how to display a list of categories from a category intersection on the archives page. For example, if the URL is http://mysite.com/category/blue+red+green I want it to say something like "Current Categories: Blue, Red, Green" at the top of the webpage. How can I accomplish this?

    Thanks!

  2. Akhilesh shukla
    Member
    Posted 1 year ago #

    <?php $args = array(
    	'show_option_all'    => '',
    	'orderby'            => 'name',
    	'order'              => 'ASC',
    	'style'              => 'list',
    	'show_count'         => 0,
    	'hide_empty'         => 0,
    	'use_desc_for_title' => 1,
    	'child_of'           => 0,
    	'feed'               => '',
    	'feed_type'          => '',
    	'feed_image'         => '',
    	'exclude'            => '',
    	'exclude_tree'       => '',
    	'include'            => '',
    	'hierarchical'       => 0,
    	'title_li'           => __( '' ),
    	'show_option_none'   => __('No categories'),
    	'number'             => null,
    	'echo'               => 1,
    	'depth'              => 0,
    	'current_category'   => 0,
    	'pad_counts'         => 0,
    	'taxonomy'           => 'category',
    	'walker'             => null
    ); ?>
    <ul>
    <?php wp_list_categories( $args ); ?>
    </ul>

    may be this will help you

  3. millett513
    Member
    Posted 1 year ago #

    @Akhilesh Shukla Thanks, I tried it and it didn't work though. It listed every single category instead of just the ones intersected on the archives page.

  4. keesiemeijer
    moderator
    Posted 1 year ago #

    Are you using a plugin to have categories show under http://mysite.com/category/blue+red+green

    If I try that on my site with correct category slugs I get a "Nothing Found" page.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.