How Add Code in Page Index Custom Template?

I want to display a code in a Custom Page (Index-sitemap) created in the theme folder.

But when I use the following code it just shows up on the Homepage.

if(is_home()  ! is_front_page()) { echo 'code'; }

Show in Home and also in index-sitemap

if(! is_home()  ! is_front_page()) { echo 'code'; }

Not Showing in Home but also not showing in index-sitemap

if(is_page(index-sitemap)  ! is_front_page()) { echo 'code'; } 

not Showing too.

if(is_page(index-sitemap)  is_front_page()) { echo 'code'; }

Showing in home and page Sitemap-Index. I want it to appear only in the sitemap-index not on the homepage how do I do that.

Cause I've used only is_page(slug) or is_page(id) too but it shows up on homepage too.

Here is my Website, https://www.cilacap.info/indeks-berita

Please help.

Topic templates Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.