Forums

[resolved] how will i List pages/category by their name not by ID ex.(include=4,5,20) (5 posts)

  1. khiangte
    Member
    Posted 2 years ago #

    Hi guys

    I want to list Pages and categories byt using their name.. no by ID ex wp_list_pages('include=45,3,4'), I want to include a pages and category using their name not by ID as example ...

    anyone please can help me out!!!!

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    The include= argument only supports ID numbers.

  3. khiangte
    Member
    Posted 2 years ago #

    Thanks

    can i do this way

    <?php $cat1=get_cat_ID('cat-name') ?>

    <?php wp_list_categories('include=$cat1') ?>

    Do you think the above will work ?

  4. MichaelH
    Volunteer
    Posted 2 years ago #

  5. MichaelH
    Volunteer
    Posted 2 years ago #

    Oops...missed this. This works for me:

    <?php
    $cat1=get_cat_ID('Currently Playing');
    wp_list_categories("include=$cat1");
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic