What conditional statement tells if you're on the home page? #852
Answered
by
danpros
rolandixor
asked this question in
Q&A
-
I hope my question makes sense, but here's what I'm trying to do: I've converted a template I wrote to a HTMLy theme, and I want to conditionally display something on the home page only (not categories or search results). Is there any way to do this? |
Beta Was this translation helpful? Give feedback.
Answered by
danpros
Jan 15, 2025
Replies: 3 comments 1 reply
-
Hello, You can use: <?php if (isset($is_front)):?>
// Your HTML code here
<?php endif;?> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rolandixor
-
Sounds like you have already tried |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi,
Dan's solution is more likely what I'm looking for. I did try is_index(),
but it causes content to render on categories and searches as well.
…On Tue, Jan 14, 2025, 9:48 PM Joduai ***@***.***> wrote:
You can also check is_index() function
—
Reply to this email directly, view it on GitHub
<#852 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEIIQY3HLOMP7HJRV52QM32KW46ZAVCNFSM6AAAAABVF4Q4UOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOBTG43TKMY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
You can use: