Hello,
A taxonomy name is displayed as a header title in a post now, but I would like to show a post title instead of showing taxonomy name.
I rewrote a litle bit of code in module_pageTit.php file and added the file to the child theme.
It worked perfect in case of post, but it duplicated the page title in case of page type. I don’t know why, because I only rewote in the “is_single() if statement”
if ( is_single() ) {
$taxonomies = get_the_taxonomies();
if ( $taxonomies ) {
$pageTitle = get_the_title();
/* $taxonomy = key( $taxonomies );
$taxo_cates = get_the_terms( get_the_ID(), $taxonomy );
$pageTitle = esc_html( $taxo_cates[0]->name ); */
} else {
// Case of no category
$pageTitle = $postType['name'];
}
Please help me this case!
Thanks in advance!
Attachments:
You must be
logged in to view attached files.