Remove the ! before is_page()
.
The function is_page()
is built into WordPress and only tests if the post being viewed is a page or not. The !
stands for “not”, so if you take it out, the code will only return true on that part if it is a page.
Related Posts:
- Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
- $post object is null
- When paginating a Page with the tag, how can the 2nd and subsequent page styles be customised?
- Why content_arr[‘extended’] removes paragraph tags?
- disable Tab post on nav-menus page (Admin)
- WordPress 302 Redirect to Random Product/Post/Page
- the_content() Not Grabbing All Content
- WordPress Sticky Post Count “Fix” Breaking Pagecount by 72 pages!
- Show only top 3 posts from 3 categories in order on home page
- Insert Shortcode exactly at the end of the content
- What function does the loop of displaying posts?
- Get the Current Page Number
- How to change the case of all post titles to “Title Case”
- Stop WP from creating “Sample Page” and “Hello World!” post
- How to display by default only published posts/pages in the admin area?
- Display posts by tag on page
- Code to auto expire posts after 30 days
- Keep a fluid max number of posts on site
- Can I change a post to a page by changing it’s type?
- Custom colors for post rows based on post meta value
- Add a custom option to a page in backend
- Custom wp_trim_words() function not trimming right
- Creating new page with pre-defined parent page
- Populating a page with content from post custom fields
- Delete Post From Front-End and attachment permanently
- Limit function to specific post category
- Function to show random posts from a category
- Hiding posts in a list from specified categories
- disable column on post and user list
- Can a page_id and a post_id be same?
- How can I display widget in a Page or Post?
- Differentiate between posts and pages in search results
- Getting a 404 error when clicking edit page
- Specifying # of Posts per page using inline post plugin (:
- Uppercase first sentence in every post
- Converting a dynamic piece of code using WordPress Loop into a static one using Post ID
- Can I use images as anchor tags with
- Force the “Choose from the most used tags” meta box section to always be expanded
- Show the content that is after the excerpt using child theme
- Switch to page template when using post permalink
- Get Page ID of blog homepage
- When open add new post or page WordPress add post with ID=0 continuously [closed]
- How do I do a page break?
- Automatically create a new page daily with last three posts
- When changing pages to posts, how do you set up 301 redirects for the page URLs?
- is_page() and is_page_template() not being differentiated
- Post type no single page
- Adding a user’s ID behind the tag ref link address
- How to create a “latest news” page showing a list of posts from blog category
- How do you search for a post or page with a certain url on the WordPress admin panel?
- How to check in functions.php if there is data in a WP_Query?
- restrict incrementation of post vies count when refreshing the page
- Display Featured Posts Grid on Static Page (Gazette)
- Having pages after specifying post_type post
- I don’t want the complete article to show on homepage
- Query function not executed between element [closed]
- posts going to 2 pages/categories only show up in 1
- Adding if statement into the_content()
- Archieve page, Advertisement Every 3 Posts
- Prevent duplicate pages from being added
- Separate blog and reviews categories
- Creating a redirect option for current page url
- I want to add another search box on posts page in dashboard
- How to put the author of the post in the comments?
- Check if almost 10 year old – working code is up to date
- Change the size of the featured image for post?
- How to add a custom class attribute into code wrapper? [duplicate]
- WordPress: Develop multiple posts with different data
- Remove pagination if search returns empty
- Remove status ‘archived’ from the default post and page view
- Remove HTML tags from all posts
- Blocked posts in network tab
- How do I customize the post page
- Clicking on a Post takes 10+ seconds for the server to respond, Pages will respond immediately
- Save All Post Permalink From A Specific Category into a .txt file
- Page with Category Returning 1
- How to Display Most View Post in the template file?
- Using WP page password protection as defacto login
- How to add post under particular pages? Like website.com/page1/post1
- I lost the link to my posts in my menu bar
- Show post excerpt
- How do I apply a wordpress function to something with no ID inside an archive page?
- Show author bio box
- Display author bio box
- Call image from post on index page?
- How do I get thumbnails?
- Page not loading content – Body archive – page
- Using Post ID and Page ID in same function
- When Author add new post change default status to pending
- How can i add new post on new page
- How to display a paginated list of posts from one category on a page? [duplicate]
- how to style an individual page in a category [duplicate]
- Redirecting posts in WordPress to a specific page
- Notify Author of the post if admin deletes his post and perform some function
- Wrap div-tag around posts in page
- Adding a post to a page
- When and how will php code in a user made WordPress page be executed?
- Post data returning null [closed]
- wordpress category Description not allowed tag
- Header and Footer options in pages and posts