You will need to create a new function. My example is a fork of the core function. The following will allow you to create a query across all published posts regardless of post_type, unless you desire that specific set.
function get_posts_by_title($page_title, $post_type = false, $output = OBJECT ) {
global $wpdb;
//Handle specific post type?
$post_type_where = $post_type ? 'AND post_type = %s' : '';
//Query all columns so as not to use get_post()
$results = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_title = %s $post_type_where AND post_status="publish"", $page_title, $post_type ? $post_type : '' ) );
if ( $results ){
$output = array();
foreach ( $results as $post ){
$output[] = $post;
}
return $output;
}
return null;
}
//This should get you an array of all posts with 'Foo Bar' as the title
get_posts_by_title('Foo Bar');
Related Posts:
- Tips for using WordPress as a CMS? [closed]
- Custom Post Type Templates from Plugin Folder?
- How to Remove Certain Screen Options and Meta Boxes from add/edit post type?
- Creating a default Custom Post Template that a Theme can override
- Jetpack plugin (ShareDaddy): Prevent share buttons showing on custom post types?
- How to make a list of companies’ information and display them to user, using custom post types and a custom taxonomy?
- Seriously stuck with some custom meta box/plugin stuff
- remove custom taxonomy metabox form custom post type
- [Plugin: Posts 2 Posts] reciprocal connections
- Custom Post Type Statuses
- How to Build a Movie Library in WordPress 3.x
- add_meta_box Callback not being called
- Star rating for custom post types [closed]
- How to Make a Custom Grid View
- Get image URL from media library in input
- Way to hook into a sidebar call to replace it with a custom sidebar
- wordpress reusable content blocks
- Should i delete the posts created by a plugin on uninstall?
- how do i remove posts from a WP_Query so the pagination is right?
- Is it possible to use WordPress as an online portfolio for text content? What kind of theme would I look for?
- How to make wp_enqueue_style and wp_enqueue_script work only on custom post type
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- Accessing post’s meta data based on user’s click of a post
- Plugin custom post type – Internal server Error
- Is it possible to create Custom Post plug-in?
- List taxonomy terms for post as checkboxes
- more types plugin – display all post of post type on page
- When using Simple Fields plugin, how do I pull the information out of the database to display on a page?
- How to make a proper custom post type link
- Matching Chapters to a Custom posts [closed]
- auto populate list of questions if user select a category xyz
- Mq translate plugin custom post type issue
- What is the best way for showing a grid of customer logos?
- WordPress custom taxonomy not showing
- Using ACF default value to autoincrement a number field
- How to Resize the Custom Post Images?
- How to use template_include hook with form submission?
- Trying to add a page template for my custom post type from a plugin, but it will not display in the template dropdown unless file is in theme
- posts from multiple post types in one slider
- Custom Post Type – custom form in dashboard
- $pages = get_pages(‘child_of=’.$post->ID); Why arguments are concatenated?
- WP-API Custom Post Type json_no_route
- Price comparison table based on Custom Post Type?
- How can I list custom post type categories of portfolio
- Show related posts based of current ACF field name in a single page post (a loop within loop)
- Plugin generated unexpected output – No PHP errors
- “Allowed memory size” problem [closed]
- Use jQuery Datepicker code from plugin
- Posts 2 Posts: Display custom types connected to the same other custom type but with another connection
- “After file loaded” action
- Including content from legacy app: via plugin or custom content?
- Dictionary-style definition list plugin
- Custom Post Type, Custom Columns List
- Error Metabox Warning: call_user_func() expects parameter 1 to be a valid callback
- Import Recent Posts Only and Ignore old ones if exist
- need click to clipboard button on my site
- WordPress REST API: Query media files attached to a custom post type
- How to get the custom field value using SQL query
- Setting Author on CPT
- Custom Post Type same name as Category
- Create category for each user
- Adding category base to url in custom post giving 404?
- How to display the category name in the tab and post inside the tab in WordPress?
- Want to build parent-child relationships between custom post types created with CPT UI
- custom post type plugin error [closed]
- How to display the custom post related blog by category?
- Undefined index: custom_post_template_present
- Add an action based on custom post meta field
- Problem with checked box on wp car manager plugin
- Merging new theme and plugins from development site to production
- Ultimate Members Default Post Layout problem
- Is it possible to customize a wordpress post from outside dashboard(Something like site.com/post-type/post/?e=post_id)?
- Calling an custom field from theme option at the frontend
- Array to string conversion error when trying to POST multidimensional array
- Creating themes using the one Plugin (Toolkit)
- How to add jquery to my custom post type wp plugin
- WordPress list child pages of custom post type
- making a glossary with wordpress
- Create custom fields on a post
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- WordPress Custom post type won’t save properly
- Making a Custom Post Type Publish Loop
- WordPress User Frontend Editing Custom Fields
- Remove base from the custom post type URL [duplicate]
- Make a magic tag work with Custom Post Types
- Display Custom Post Type and Custom Taxonomy Data on Front End Using Only a Plugin
- WordPress show different custom post type
- How to export post tags from wordpress
- How to access the page without registering in wordpress
- CPT template is not being automatically used single post pages
- Set the title of a custom post automatically by using info from custom fields?
- public custom posts not showing in my wordpress plugin
- plugin translation *.mo file not getting loaded for custom post
- How to provide page_template path in custom plugin using WordPress
- Create CPT on Ajax Call
- how to compare date meta value in jet smart filter Date query?
- My site has only one page, and users access my uploaded mp3 files from there – can I analyze access by song title?
- Tickera missing attendees – No attendees found
- How to check if the post exists in any of the categories?
- How to Display News in a Timeline with Headline, Category, and Time?