tejasbramhecha
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: searching multiple custom post types using rest apiHi,
Will you please let us know how to put OR conditions for search query here. I guess, by replacing spaces with + signs, you have AND conditions over search & so it is limiting the results. Kindly let us know what can be done here.
Thanks,
- This reply was modified 8 years, 6 months ago by tejasbramhecha.
Forum: Fixing WordPress
In reply to: call wordpress rest api using multiple tagsHi @jakept
This plugin is okay for filtering tags but what if I want to filter categories for custom post type? e.g. wp-json/wp/v2/portfolio?filter[category]=”analytics,cloud”. Is there any plugin for this or do I need to do some modifications for the same?
Forum: Fixing WordPress
In reply to: Call WordPress rest api using links/urlHi @jakept,
I tried this but I’m getting null/[] in json output.
Forum: Fixing WordPress
In reply to: Call WordPress rest api using links/urlHi @jakept,
I’m now able to access portfolio data using wp rest api but the json that I’m getting is not having any category id/tag mentioned in it. Will you please let me know what can be done to make sure that I get category id/tag?
I have written code as following:
/** * Add REST API support to an already registered post type. */ add_action( 'init', 'my_custom_post_type_rest_support', 25 ); function my_custom_post_type_rest_support() { global $wp_post_types; //be sure to set this to the name of your post type! $post_type_name = 'startapp_portfolio'; if( isset( $wp_post_types[ $post_type_name ] ) ) { $wp_post_types[$post_type_name]->show_in_rest = true; $wp_post_types[$post_type_name]->rest_base = $post_type_name; $wp_post_types[$post_type_name]->rest_controller_class = 'WP_REST_Posts_Controller'; } }Thanks,
- This reply was modified 8 years, 8 months ago by tejasbramhecha.
Forum: Fixing WordPress
In reply to: Call WordPress rest api using links/urlHi @jakept,
I want to retrieve portfolio data from my website. Is there any way that I can make a call to wp-rest-api & get it? If yes, can you please let me know how? If no, can we add custom post type as portfolio in wp-rest-api code & make it work? Unfortunately, I’m unable to find proper documentation regarding custom post types. Shall be grateful if you can help somehow.
ThanksForum: Fixing WordPress
In reply to: Call WordPress rest api using links/urlHi @jakept,
I could fetch posts by using category id now. But for some ids it shows null to me even when there is data in backend with that category id. Would you please let me know why is it happening so?
Forum: Fixing WordPress
In reply to: Call WordPress rest api using links/urlHi @jakept,
I’m running this directly on postman. There’s no code. The simple aim that I have here is to retrieve posts that have this category id. I have checked my categories too to ensure that the id I’m using is there in dataset.
Forum: Fixing WordPress
In reply to: Call WordPress rest api using links/urlHi @jakept,
I tried the solution that you gave to me. I tried to get posts using following api call: /wp/v2/posts?categories=category-id-that-I-found but this returned me something like this “Unexpected ‘<‘”. Would please let me know what’s wrong here?
Thanks
Forum: Fixing WordPress
In reply to: Call WordPress rest api using links/urlHi @jakept,
May I know if we can retrieve posts using title?
e.g. /wp/v2/posts?title=Testing Cloud Securityor is there any way to do this?
ThanksForum: Fixing WordPress
In reply to: Call WordPress rest api using links/urlHello @jakept,
What I’m trying here is to get json data from wordpress but to call wp rest api, I need something like tag/category/id, right? but all that I have is link/url so I am just asking if I can call wp rest api using that link which is available to me & get json data? If yes, how