• hello again.

    I need some help, I have a page and it takes me to the id of the category and sub​​-categories in this category

    example:

      Photoshop

    • File 1
    • File 2
    • File 3
    • File 4

    wanted her to take the form of ID automatically because I want to use the same other page of the same type

Viewing 4 replies - 1 through 4 (of 4 total)
  • is that a category archive page?

    if so, you can get the category ID with:
    $cat_id = get_query_var('cat');

    and any sub categories with:
    $sub_cats = get_categories('parent='.$cat_id);

    http://codex.wordpress.org/Function_Reference/get_categories

    otherwise, please post more details.

    Thread Starter uandersonft

    (@uandersonft)

    I want that when people choose an option it lists the details of this option to the top and just below show the sub-categories, they can be anything, lessons, videos and tutorials

    I’ll see if I can do what I need with the function you gave me

    anything I return

    thank you

    Thread Starter uandersonft

    (@uandersonft)

    giving details, I want to use the id of the subcategory for use in query_posts to display all items in that sub-category

    Thread Starter uandersonft

    (@uandersonft)

    this way you told me to go to work only sub-category to category pq doubles several times, but the paging does not work know how to fix this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘how to get the id of the category and sub​​-category’ is closed to new replies.