php - How can I tell my wordpress to do something in the header if its a blog page? -
In the previous post () I asked how I would go about having a div echo in my headers if the user with a The URL in the URL load / header
The one I did not take into consideration was that I do not want to display the div if it got not only the blog / blog in its display, but if any of its blog Post, not just index page blogs.
If I see that blog is a blog post then how do I run some code from my header.php?
You will use the WordPress function is_single () and is_page.
If (! Is_single () and! Is_page () & amp;; Is_home () & amp;; Is_archive ()) / / This will not display for anybody Post, page, home page or a collection You can remove each statement according to your needs * /}
For posts only, use_using, page, home and archive for one That's it.
The complete list of Is_statements can be found. Here are some others:
is_home (): home page is_front_page: front page is_single (): single post is_admin (): admin panel is_sticky (): sticky post is_page (): page is_category is_tag Is_author
Comments
Post a Comment