wp-knowledgebase icon indicating copy to clipboard operation
wp-knowledgebase copied to clipboard

problem with page title and custom templates

Open Jimmi08 opened this issue 7 years ago • 0 comments

I copied templates to my theme and I couldn't get page title displayed. There is this code: <h1><?php echo get_the_title( KBE_PAGE_TITLE ); ?></h1>

But in KBE_PAGE_TITLE is slug, not title define( 'KBE_PAGE_TITLE', kbe_get_knowledgebase_page_id() );

function kbe_get_knowledgebase_page_id() {
	return get_option( 'kbe_plugin_slug', false );
}

This was quick fix in kbe_knowledgebase.php:

$page = get_page_by_path(KBE_PAGE_TITLE);
<h1><?php echo get_the_title( $page->ID ); ?></h1>

Jimmi08 avatar Feb 20 '18 13:02 Jimmi08