Q:

WordPress - Page Name

I am new in WordPress. I installed plugin "html-on-pages". This plugin add ".html" after page name in URL.
I added some pages in my WordPress project.
I want to remove '.html' in some conditions for some pages. I try to get name of page using $wp_rewrite of WordPress but not found any way.
Please suggest any way that return name of page or any function of WordPress that will return name of page.

A:

Try this
$page_name = basename(get_permalink());

