get_children
is the most straightforward way to get “attachments, revisions, or sub-Pages”. So…
$children = get_children(array('post_parent'=>$post->ID));
if (!empty($children)) {
foreach ($children as $child) {
echo '<div id="child-'.$child->ID.'" >';
// content formatted however you want
echo '</div>';
}
See the Codex page for further parameters that you might need.
I don’t know how you’ve constructed your drop-down menu but you can link to any element on the page using its id
attribute so your href
for the links should be #child-<ID>
, preferably constructed as an absolute URL.
Related Posts:
- How to use wp_nav_menu to create a select menu dropdown?
- how to get value of wp_dropdown_categories
- Filter a second dropdown list when a value is chosen in the first one
- Improving the Thesis built-in dropdown menu via javascript
- Add submenu using the bootstrap wp_nav_menu
- Drop-down menu with wp_dropdown_pages
- How to number the options in a wp_dropdown_pages() select?
- Selected attribute of Drop down list
- Ultimate Member callback function issue
- WordPress bootstrap menue with 3. level
- Filter table with dropdown
- Get the selected option from drop down list
- getting the current sub item out of total sub items in a given dropdown (custom walker)
- pages meta box – get_categories dropdown
- Use a filter on menu items that have children
- Bootstrap drop down Navigation Menu in WordPress
- wp_dropdown_pages : choose post status to list in dropdown
- create drop down menu
- why is this function firing on all child menu items as well?
- How to use wp_nav_menu to create custom dropdown menu?
- How to populate a dropdown menu with option selected?
- Using wp_dropdown_users and selected() function?
- Dropdown primary navigation menu not working
- Is there any way to change the CSS class applied to 2nd level sub menu ul’s?
- working with result of wp_dropdown_pages()
- Help with a get_categories () drop down menu – I want it to show in heirachial form
- Dropdown list control in a post
- Theme: dropdown hover menu not showing up in IE/Edge
- wp_dropdown_users array for param selected
- top primary menu drop down categories not showing
- First ID won’t be excluded in wp_dropdown_pages with an $arg from tax_query
- Reveal hidden submenus on page load – Twenty Fifteen theme
- Multiple Dropdown’s with Submit Button
- Create a drop down list within an active page not nav menu
- wp_dropdown_categories – remove
- Should I custom code drop down menus or use a wordpress plugin?
- PayPal button with drop down menu not working [closed]
- How to solve dropdown menu problem [closed]
- What is the best way to incorporate responsive dropdown navigation menu into custom theme?
- Dropdown Value from DB Entry
- Making a filter searchable on the page of post list at WordPress backend
- Select default option value from typescript angular 6
- Display a portion/ branch of the menu tree using wp_nav_menu()
- Any docs for wp_nav_menu’s “items_wrap” argument?
- Is It Possible To Add Custom Post Type Menu As Another Custom Post Type Sub Menu
- How to add sub-menu to a menu generated by wp_nav_menu by using plugin
- Remove Categories / Tags From Admin Menu
- WordPress API Menu/Submenu Order
- Add an admin page, but don’t show it on the admin menu
- Getting custom admin submenu item to highlight when its active
- Taxonomy dropdown metabox in the back-end
- Add custom menu item using wp_nav_menu_items filter
- Does Extending Multiple Nav_Menu_Walkers Allow Nested Menus?
- how to create a menu with all sub categories?
- Custom menu walker: how can i check first item
- Removing filter dropdown in posts table (in this case Yoast SEO)
- Custom Taxonomy as Dropdown in admin
- Remove a menu item created by a plugin
- Add separator to admin submenu
- Add a dropdown to theme customizer
- Display only page specific sub menu items using Custom Walker
- Add custom html to last sub-menu item
- restrict_manage_posts not working in 3.3.1
- wp_dropdown_categories in custom post type with custom taxonomy
- Add a .last class to the last in each ul.sub-menu
- Order Admin sub-menu items?
- How Can I remove or hide the export page in WordPress menu?
- Get page by template?
- Multi Level Bootstrap Navigation Menu in WordPress
- Add class to top level menu item if it has multiple child levels
- How show sub menu only using wp_nav_menu()
- How to give position to Submenu under custom post type
- Bootstrap dropdown nav pills not working with wp_nav_menu()
- Show only 2nd level of navigation depending on active navigation
- Reorder custom submenu item
- Dropdown with category selection
- How to add a child item to a menu element (using wp_nav_menu_objects)
- Show child pages by menu order using Superfish Dropdown menu?
- Simple Navigation Walker – Wrapper-class around first sub-menu
- Bootstrap drop down menu with wp_nav_menu
- How Do I Programmatically Better Organize Custom Post Type Menus?
- How to get a separate child menu?
- Exclude one item from wp_list_pages( $args );
- How to create a drop down menu like in twenty eleven theme?
- Block Editor: add an aria-label to an option inside a SelectControl
- Is there a way to keep a custom menu expanded when editing a custom post type?
- How to store the value of a custom field dropdown select for post referencing?
- Filter results with custom field values and dropdown
- wp_nav_menu() loses ‘current-menu-*’ classes on single product page within category
- Drop down+sort blog posts date added/most popular
- List custom post types in dropdown
- How to drag multiple menu items at once in WordPress?
- Customizing the a tag with Semantic UI
- How do I give class to the dropdown sub-menu in the wp_nav_menu?
- How can I show drafts in wp_dropdown_pages list?
- Dropdown: Display terms from B only if has relationship with a term A selected
- checkbox in post add/edit to add/remove the post from menu
- No authors in change author dropdown
- Primary and secondary menus
- Put a wp_nav_menu inside another one