Use get_the_title
Replace the last part of code
if ( $childpages ) {
$result="<h2>" . 'Parent title here' . '</h2>' .
'<ul>' . $childpages . '</ul>';
}
with
if ( $childpages ) {
$result="<h2>" . get_the_title( $parent_id ) . '</h2>' .
'<ul>' . $childpages . '</ul>';
}
This may also help.
Related Posts:
- List child pages of specific page using shortcode
- Shortcode producing headers already sent error
- List all-childpages on parent-page AND list child-pages on childpage itself but not the current one?
- Sort and display pages with specific custom field (not tag)
- Display list of pages that contain a certain string within the slug
- How to display random users with avatars
- How can I programmatically create “child” pages on theme activation?
- Breadcrumbs showing Parent and Child Pages
- Creating a table from shortcode avoiding wpautop for each row
- Changing a function in function.php to a shortcode – for listing categories of only a certain post type
- Stripping shortcode from custom excerpt function
- how to create shortcode in wordpress
- Display random text from a file with the WP built-in AJAX API
- Formatting post content to exclude gallery
- Shortcode with custom content attribute?
- Problem with extract() with custom shortcode
- Shortcode to insert menu in page body?
- Using locate-template & shortcodes doesn’t appear to work
- Displaying a random user with a shortcode
- Passing HTML in WordPress Shortcode arguments
- Function to show only first instance of shortcode
- Query children and parent title
- creating shortcode to pull json array
- Custom Shortcode, functions PHP WP_Query loop
- Pass Shortcode Attribute to footer Script
- Super simple shortcode not working
- Detect Safari desktop browser and include the detection in a shortcode
- My simple custom shortcode is not longer working (possibly due to upgrade to WordPress 4.4 ?)
- Display gallery on top before content
- How to extract the variables out from “add_shortcode” function?
- WordPress shortcode attributes for database SELECT?
- create shortcode to list users with specific meta key value
- Variable if post is sticky in functions.php
- Display post shortcode content in the sidebar?
- Using shortcode content with nested shortcode
- How can I make a widget shortcode to control all the widgets?
- Custom shortcodes not inserting into visual composer columns
- Setting youtube size in functions.php
- Adding a colorbutton in tinymce dialog with current api
- Passing variable as add_shortcode argument
- new_excerpt_more link not working properly
- Excerpts are not displayed by a shortcode on category pages
- check if the user is owner of current page
- shortcode help require
- Optimizing a WordPress site
- Use html inside shortcode function
- Shortcode parse error – wrong syntax
- wp_nonce_field is breaking form for reasons unknown
- Visual Composer creating own shortcodes with vc_map() to return simple Image
- Function shortcode – Set Parameter
- Using multiple line variable inside a function?
- Echoing function into WordPress NextGen gallery
- Output loop to function return?
- How to echo the value of an array element using a function via a shortcode
- Wp-query Order By problem
- How to parse a shortcode within a shortcode?
- Variables not showing in short code
- How to include any template using Shortcode fuction?
- Need to convert image url to a Base_64 data url with wordpress function..
- How to create shortcode with html and php content?
- Shortcode question
- Using depth=n in wp_list_pages
- Do we need to change our child function.php to require/include child dir files when we add an over-riding file.php into the child theme
- Shortcode to get featured image of specific id post
- Modify shortcode to work with custom post types
- How to hightlight all ancestor menu items of a child page NOT displayed in menu
- shorthand syntax for custom fields
- show all the posts thumbnails
- How to apply the ‘current_page_item’ class to an archive page in `wp_list_pages()`?
- Problem with shortcode inside a shortcode
- Need help making a short code work
- Display a list of random terms from custom taxonomy with shortcode
- Load templates, pass arguments, and render output from functions.php
- Passing function arguments via a shortcode
- Customizing the wp_video_shortcode output with add_filter
- Probleme shortcode with list author
- Last updated posts shortcode in functions.php
- Shortcode to output category description by passing ID
- Help using ShortCodes to style whole chunks of the post
- Show users last read posts for each user?
- HowTo: Add wrapper to columns shortcode?
- Shortcode Function – Can’t get anything else to return after running shortcode within shortcode
- Custom shortcode with do_shortcode and substr
- Shortcode to eliminate and replace with
- Can I use a function to return HTML and the result of another function?
- Problem in shortcode outputting content
- Expanding a function to call a plugin or show a link
- Trying to the deduce shortcode from a function
- Pull random comment from specific post, display on homepage with shortcode
- Set thumbnail from URL, by grabbing image in functions.php
- wp_list_pages change of children and anchor of parent
- using enqueue_script in a shortcode isn’t working
- Run function from parent on child site
- Gallery Shortcode Function Help
- Echo custom field value in shortcode function
- Shortcode Variations?
- Custom shortcode not being included in content paragraph [duplicate]
- Creating mixture of shortcodes to use in the visual/text editor
- PHP error in shortcode [closed]
- multible shortcodes (for differnt values) with one function