WordPress: How to get/set "post parent" as "page title"

<?php /* * if post parent is not present, get page title, else get/set post parent as page title. */ echo empty( $post->post_parent ) ? get_the_title( $post->ID ) : get_the_title( $post->post_parent ); ?>

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.