php – How Add Code in Page Index Custom Template?

Question

Good Afternoon My Friends, 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.

0
Cilacap Info TV 2 months 2022-06-04T00:50:07-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse