This part require('./wp-blog-header.php');
is all kinds of bad idea. And if your file is indeed in plugin folder then header isn’t even in that location.
Custom loads of WordPress core are brittle and the technique is typically only justifiable for performance reasons.
It would be better to structure your endpoint via creating actual rewrite endpoint, or making use of admin-ajax.php
/admin-post.php
.
Related Posts:
- Retrieving 3 latest post from each of 5 different custom post types
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- Query to get the author who having maximum number of post (custom post type)
- Quickest way to get last or oldest post date – WP Query
- Stuck in Order by more then one
- Including metaboxes from custom post types in global search — continued
- Query Multiple Custom Posts by Custom Fields
- Group by custom field value (start and end times)
- A faster way to query custom post types with multiple conditions?
- Get posts by category name
- How to properly use Categories with Custom Post Types
- date_query empty results with custom post type
- WP_query has incorrect wp_posts.post_name = ‘asc’ when I have custom post type called ‘order’
- Query a custom taxonomy in a function to create an csv file
- Query posts based on user preferences
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- Get post from Category by Priority
- How can you use a page for a custom post type?
- Custom post order when using OR relation
- Query posts by a type and another type only if post is in specific category
- shortcode for recent custom type post
- How do I correctly query posts from a post ID?
- Get Posts in a Custom Post Type category
- Getting the Intersection of Two Custom Taxonomy Terms for a Custom Post Type?
- Displaying Posts Related to Other Posts by a Taxonomy Term?
- How to query for posts (in hierarchical custom post type) that have children?
- Combine tax_query and meta_query in WP_Query
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- WP_Query pagination using only numbers instead of /page/1 on URL
- Query for posts in 2 taxonomies
- SELECT * FROM $wpdb->posts WHERE ID > 160
- Parent / Child formatting in a list of post of a custom post type
- How do I create an archive page for standard posts?
- Multiple post type queries (with specific arguments for each)
- Custom Post Type Loop within Shortcode
- Combining sorted and random CPT
- How to add post_type=value when editing that post type in the WordPress admin?
- Display CPT posts based on specific taxonomy
- WP_Query: include custom post type only with specific meta value
- showing custom post types of a certain category only
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Custom taxonomies relationship
- Prioritize posts in query by meta keys?
- WP_Query orderby and tax_query
- Configuring a meta query with multiple post types that have the same relationship on a single page
- Different Ways to Query Custom Post Types?
- Possible to filter custom post type with multiple meta data?
- Loop increase number
- Front end access to a SQL data repository – recommended way?
- Custom filter for main search: how to exclude specific post_type from search results
- Inefficient Query Confusion
- how to get this tax_query working?
- find custom post type post by searching its custom field with my string
- wordpress lists similar type of posts in a custom post type
- FacetWP paging custom wp_query
- Custom post type and custom taxonomy 404 on page 2
- Cannot get custom posts by category
- Shortcode with WP_Query more than once on one page
- Why the_excerpt() function returns excerpt on the Home page and trimmed content in sidebar?
- list posts of two post types in a single template
- Using WP meta query to show custom post types by a start and finish date
- How do I list a custom field and custom taxonomies for each result in a loop?
- Getting the list of the latests posts and custom type posts in the homepage
- Find Posts based on Child Post value
- set object terms after some some time of published post – functions.php
- Change search query in wordpress custom post type
- Sort custom posts by date and then by taxonomy
- Query custom post type that has a serialized relational advanced custom field value
- Custom post type data not displaying If I select the category from the dropdonw
- build child and anchestor three from post parent
- Limiting the Number of User Posts to Their Own Posts
- How can I query and sort custom-post type using WP_Query
- Custom query result empty on page 2
- How select query is generated in a Custom Post Type?
- WordPress doesn’t respect Page slug in custom post type url pagination. Keeps getting removed
- Output all terms slugs for a loop filter
- Post Query , breaks layout if a post is deleted
- Not able to get my custom search result using meta_query and tax_query together?
- Multiple WordPress Sites, Same Database but Filtered Content
- Error get_posts with Custom Taxonomy and OR relation
- Custom Field as Custom Post type element class
- Display posts on parent post if author coincides
- WordPress query in which condition uses custom field
- How to get Current week and current date record wp query
- Error in WP Query. If variable is empty it is displaying previous post value
- Certain number of posts with certain excerpt length
- WP_Query for CPT with filter by another WP_Query
- Is it possible to add query parameters on the archive page?
- Query stopped working
- WP_Query and two custom fields returns no posts
- Storing/querying custom date data
- Query Posts From Multiple Post Types
- Custom Post-type not returning the right child_of
- How do I hide single category post on my post page
- show custom post’s post in two different divs [duplicate]
- Get images only from a certain post type
- querying to custom field over ACF REST API
- WP Query + custom fields: How to query event posts from the current date backwards 6 months and organize it month by month?
- How do I get parameters from the URL?