Jump to content

Is there a conditional like if (is_home)?


Recommended Posts

Hello,

I want to run some code in header only for home page. Is there any conditional like in Wordpress if is_home() or if is_page(X) do this or that? I have looked at Smarty with no success.

Thank you in advance for your help.

Note: I have done this:

{if $page_name|escape:'htmlall':'UTF-8'== 'index'} code here {/if}



and it works. I don't know if this is the best way of doing it though...

Link to comment
Share on other sites

  • 1 month later...
Hello,

I want to run some code in header only for home page. Is there any conditional like in Wordpress if is_home() or if is_page(X) do this or that? I have looked at Smarty with no success.

Note: I have done this:

{if $page_name|escape:'htmlall':'UTF-8'== 'index'} code here {/if}



and it works. I don't know if this is the best way of doing it though...



I have done this also with success but would welcome a confirmation whether this is the best approach.

Can anyone confirm ? and/or correct ?

Thanks in advance
Link to comment
Share on other sites

×
×
  • Create New...