The second parameter for get_page_by_title()
is $output
, with the third being $post_type
.
This should solve your porblem –
$patchwork = get_page_by_title( 'Patchwork 01', OBJECT, 'patchwork' );
echo $patchwork->ID;
Please have a look at the Function Reference for get_page_by_title()
for more information.
Related Posts:
- Using save_post to replace the post’s title
- How do I safely change the name of a custom post type?
- limit selection of custom taxonomies to one?
- why doesn’t the_content() work in this {single-custom_post_type.php} page?
- Custom Post Type Menus
- Custom Taxonomy Template Post List with Sort Order
- Hiding Custom Post Type from Google?
- Display Custom Post Type Fields
- functions.php conditional tag only for custom post type
- Get monthly archives for custom post type
- How to get dynamically custom post type that are under a certain category
- How to show related posts by category or custom post type?
- Custom Taxonomy returns no posts
- Display taxonomy term only if there’s a value
- Custom/separate categories for custom post type
- How to delete all posts from a custom post type?
- Update content of multiple pages/posts at once?
- Query custom post types and a specific page?
- Custom Post Type Pagination & duplicate posts
- Page as a child of a Custom Post Type
- Custom post types and permalinks
- using add_role function to make some users to create a selected type post
- Custom Post Type and API REST is not working
- Display custom field of specific post where post title matches variable
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- Change URL of posts and also Custom Post Type
- Show Different Header on a Specific Post ID
- Normal pages as children of my Custom Post Type
- Diplay content from custom type as widget or sidebar?
- Custom post type and taxonomy slug issue
- WooCommerce product search titles only
- Related posts in all categories of current post (custom post types)
- Cannot save Checkbox meta box value from a Custom Post Type
- Custom Post Type template stored in plugin folder not showing in post attributes dropdown
- Change Slug in URL of Posts of custom post type
- Add a button or image button that calls wp functions in the wp-admin
- Get parse_query filter to return slug instead of id
- Custom post ui plugin & WP_Query – Polylang
- How to add a post slug to a url?
- Change CPT archive title
- Help with Elementor Pagination CPT archive 404 problem
- Adding custom post type to count in category
- Custom Permalinks with CPT and Hierarchical Taxonomies
- Canonical url differs from custom post type archive URLs
- Invalid argument supplied in register_taxonomy $args->taxonomies
- Ignoring slug capitalization on rewrite rule for custom post type archive page
- How to sort posts in a custom post type by title in ascending order by default?
- custom post type vs. conditionally displaying meta boxes for specific terms?
- data-type=”” … needed post tags stripped of characters
- Add first letter of titles to array, then compare arrays
- Bootstrap accordion looping through posts incorrectly
- Use Pages for Custom Post Type
- Create a list of recent Custom Post Types posts
- Search Filter CPT, Custom Loop
- Get post ID of either existing post or new post
- Create a simple Testimonial page
- next page with custom post
- What should I learn to develop event management in wordpress? [closed]
- Why is the output of a call to the_excerpt different when the call seems to be identical?
- What is the best way to manage small blocks of content on my home page?
- Only looping through pages that have children or subpages
- Two-way synchronizing of a post type among multisite blogs
- How to sort WP_Query by a custom text field (written as a date dd/mm/yyyy)
- Auto update publish date of CPT Post if default post custom field value match to cpt post CF Value
- Custom post type rewrite url structure with taxonomy and sub taxonomy
- list articles in admin showing nested categories or slugs?
- How to upload two input files [closed]
- Hide the update button from edit view in wordpress custom post type
- Custom metabox with image gallery upload that won’t attach images to post
- order custom post type posts by custom date
- Standard Page Child of CPT Not Found (404)
- Custom Post Type parent/child relationship rewrite rules for permalinks
- Related posts by taxonomies does not work , what could be the reason?
- Display first post of a term in taxonomy template
- How to transfer categories (default) to custom taxonomy?
- How to stop post status from reverting to Published?
- Query posts based on user preferences
- call a function when insert and update a custom post type
- How can I remove “Add new” button on custom post type
- Custom Pagination based on Custom Post Type
- WordPress custom post type
- How to have working breadcrumbs with several taxonomies associated with a custom post type
- Custom Post type archives / categories give 404
- Sorting on Taxonomy in archive page
- Redirect preview single post link to a page
- Front-end form submission not creating post
- Yearly Archive from a custom date metabox (Event Start Date)
- Custom options for a Custom post type
- 404 with Custom Post Type
- Custom loop won’t work, can’t find problem
- link posts to custom post type
- Add top-level menu pointing to a different custom post type?
- custom post type not getting archived?
- Most appropriate way to display CPT’s by children terms of custom taxonomies while retaining desired permalink structure?
- See the process of creating a taxonomy and tell me where I made a mistake
- Google Analytics Dashboard for WP in Custom Column
- Navigation won’t update to show full path to single post
- Show custom category archive as front page and remove taxonomy slug from urls
- Post object GUID adding http:/
- Meta_query question