As per docs you only need to specify different post type to make it work:
$page = get_page_by_title('testpage', OBJECT, 'post');
Related Posts:
- Turn a URL into an Attachment / Post ID
- Should we trust the post globals?
- How to get the number of posts in a selected category?
- how to limit edit_form_after_title hook to page and post edit only?
- Add a checkbox to post screen that adds a class to the title
- How to cache a shortcode functions output?
- Attach pdf file to custom post type
- How to call function within a page/post, to dynamically generate content?
- Post Size Limit
- Count singular post views automatically
- Looping through posts per category gives same posts for each category
- How to force update all posts after import
- how to hide specific post from google search
- Accessing $post variable from template part
- Programmatically inserting page breaks
- How to have different content in the loop and single
- Make “Post published. View post” Open in a New Tab
- Custom Post Type & Author not associating, user post count is 0, api doesn’t return author in post objects
- get_terms parent for current product only
- How can I extract the URL of a link from a post?
- New posts defaulting to ‘0’ primary key
- Save list from a custom meta box?
- Same content shared between multiple posts?
- How to add in title a date but with other color, like in iMDb titles?
- Link button is not working while editing a post in Firefox [closed]
- How to get future ID for post which haven’t been created yet?
- Post Type Label Name
- Disable author profile in post
- Limit Gutenberg blocks available to users to choose from
- Display a post by ID attribute with shortcode
- Retain select value in select box
- How to set up multiple taxonomies for groups of posts
- Update admin side post list count text
- How can I set a Post’s default visibility to private and pending review checked
- how to get posts ids inside pre_get_posts filter?
- Blog Posts in Custom Menu
- How do I get blog posts to appear within CMS?
- Search by post title and content in wp_query without order
- Append class to posts page
- Error after upgrading WP from 4.0.6 -> 4.4.2: empty value in wp_post_types[‘post’]
- What’s the best way to render Visual Composer in posts, not pages?
- Trying to use AngularJS with WordPress without any API
- Showing author page if user has no post
- Get Value of Post before
- post category in wp_insert_post
- Show comment number per author per day
- Fixing paragraph spacing in posts
- Customize rel=canonical tag for single blog post
- Make a vertical dynamic list of posts in alphabetically order and in columns [closed]
- Display posts of specific category term
- Widget that shows categories with posts numbers
- Hide comments and posts posted by other user
- How to remove specific tag from multiple posts?
- Why this function doesn’t works without the_post?
- Why can’t publish posts with too much text?
- wordpress add field to post_class
- How to store array in usermeta in wordpress
- Setting limit to posts or page creation
- write a post on user registration
- Cannot select certain authors for posts after import
- Lightbox on wordpress post page
- Can Permalink structure of %postname%/%post_id% improve performance
- post/page content
- WordPress Architecture as a CMS – Posts & Pages
- Getting post and attached image from subdomain
- How to automatically share posts on facebook?
- Merge get_comments & get_posts into a single query
- Is there a way to categorize a list posts all at once?
- Display “no post” message
- Not adding a new post?
- On the online version of my blog posts disappear
- Thumbnails and images in the blog post are not loading
- Automatically delete post in a single category when a new one is created
- Multiple posts in one page
- post__in no longer works in wordpress 5.0.3
- allow editor/author to publish others posts but not publish their own
- Why does media_handle_sideload upload to last month’s folder?
- Re-order Category Meta-data
- Slug collision between page, taxonomy and custom post type
- Populate a drop down list with post titles across a multisite network
- What’s the best approach to create duplicated pages with paginated posts?
- including 404 page in post page
- How to allow some visitors to edit inline specific post
- Posts only showing on /localhost/wordpress/ and not on other pages
- How to change number of posts shown on homepage vs other pages?
- Posts are printed twice
- How to display most popular posts from certain category in sidebar?
- Is possible to do this from function.php
- Custom filter on all post page (admin backend)
- Make Show Notes for Individual Podcast Episodes Easy to Find (multiple URL’s?)
- Displaying only posts from a certain category on my custom page template
- How can I create a menu items from meta box based on users input
- How can I count articles retrieved by tags
- WordPress strips some attributes for author posts
- Creating / Editing a post from within site template
- display only the title of the post into a certain category
- WordPress “Posts Page” isn’t showing template dropdown
- How can I get on the same row two post of different categories?
- website images getting corrupt automatically
- Posts Page in WordPress loading bare HTML of my homepage