Hi, congratulations (I´ll purchase my second license for sure…)
What code must I use to set up the page title with the parent title (in case that page has a parent page)?
When using sidebar, parent and child pages, and page title it would clarify the structure.
Thanks.
OSCAR
Hey!
Try adding this at the very end of your theme functions.php file:
add_filter('avf_title_args', 'parent_page_title', 10, 2);
function parent_page_title($args,$id)
{
$post = get_post($id);
$title = empty( $post->post_parent ) ? get_the_title( $post->ID ) : get_the_title( $post->post_parent );
$link = empty( $post->post_parent ) ? get_permalink( $post->ID ) : get_permalink( $post->post_parent );
$args['title'] = $title;
$args['link'] = $link;
return $args;
}
Cheers!
Josue
Just perfect!!!
Best.
OSCAR
You are welcome, always glad to help :)
Regards,
Josue