Using depth=n in wp_list_pages

I’m wondering what is the proper way to use depth n in wp_list_pages. I currently have a menu in my sidebar that goes 4 levels deep but I’d like to prevent levels 3 & 4 from displaying.

The codex says:

‘depth’

(int) Number of levels in the hierarchy of pages to include in the generated list. Accepts -1 (any depth), 0 (all pages), 1 (top-level pages only), and n (pages to the given n depth). Default 0.

I’ve tried:

wp_list_pages('child_of=124&title_li&depth=n(2)')
wp_list_pages('child_of=124&title_li&depth=n2')

I can’t seem to find any examples on how to use depth in this instance.

Solutions Collecting From Web of "Using depth=n in wp_list_pages"