I've searched a lot and I couldn't find anything, I'm looking for a way to create a function to get the result if a channel is streaming or not and store the result in a shortcode. I have tried a thousand ways to make a request but I am unable, now I just want to get the shortcode so I can use it for my website.
Related
How do I get the trackback count of a post in wordpress without writing an SQL query?
I tried searching Brave Search and I couldn't find anything helpful. To fetch the amount of comments a post has, get_comments_number() is the wordpress protocol function for it. But what if I want to fetch the amount of trackbacks a post has?
And also, do I have to be inside "the loop" to do this? What if I'm outside the loop?
I'm developing an ASP.NET Core web application using WooCommerce REST APIs (I'm also using the WooCommerceNET library), and I need to implement a search text input field with a simple Search button.
No problems with that, the issue is that WooCommerce returns 100 items max per page, so the following does not work (this code runs after the property Products has been populated, of course):
if (!string.IsNullOrWhiteSpace(searchString))
{
Products = Products.Where(p => p.name.Contains(searchString)).ToList();
}
Since my WooCommerce website contains 23k+ of products, I can't just do multiple (230+) requests, it would take forever.
I thought about having a parallel local database or something similar which gets populated when it's needed, but then I realized that maybe, if I'm lucky, it exists some sort of parameter that I can pass to the request in order to filter the research directly in the http request, so it would already return 100 results of my research.
I didn't find anything about that googling around, so I'm asking here if this is a thing and if it's not, then how to solve my problem in a different way.
It was pretty easier to find than I thought, indeed there is a parameter which can be used in the link, here's an example that works for me:
/wp-json/wc/v3/products?search=stringToSearch
I'm using WP WooCommerce and I want to add custom product fields that shall be used in conjunction with the API Client Lib.
I followed this guide to the end and everything works fine, except for reading the data. Now, I'm using the API Client Library for processing the orders where I want to fetch this meta information of the products. But how to I access this information? Since my script does not run within the WP loop, I can't access any get_post_meta function or the like. It is also not listed in the product meta, I get from the API (and I don't understand why).
The only solution I see right now is to get the data directly from the wp_postmeta table in MySQL. Is this correct or is there any other, more elegant, way to get this data?
Thx for any help.
Edit: I use workaround for this problem now. Since there is seemingly no way to access the product meta data outside of the loop, I now use WP's native custom fields to retrieve that data. In contrary to the WC product meta data the WP custom field can be accessed via the WC API. The data sits in the parent of my product, so I can access it by making a second API call for the parent.
I am trying to write a program that extracts shipping container information from a specific site. I've had success with several shipping companies wbsites that use POST methods to submit searches. For these sites I have been using cURL, a PHP libary. However, this one site http://www.cma-cgm.com/eBusiness/Tracking/ has been very difficult to interact with. I have tried using cURL but all I retrieve is the surrounding html without the actual search results.
A sample container I am trying to track is CMAU1173561.
The actual tracking URL seems to be http://www.cma-cgm.com/eBusiness/Tracking/Default.aspx?ContNum=CMAU1173561&T=292012319448 where ContNum is the shipping container and T is a value constructed from current time.
I also noted the .aspx. What is the best approach for retrieving these search results programatically?
may i know how do i set the number of feeds displayed on a word press blog?
for instance, i used
http://beautifulreminisciencezz.wordpress.com/?feed=atom&year=2009
But it returns me only ten results.
For blogger, I know the query parameter is 'max-results'
However,t here's nowhere in wordpress where they mentioned the query parameters for this.
Anyone have any idea?
I think you can set it from the Reading Settings in Wordpress.
I'm just starting with WordPress myself, but I did notice the paged=<num> query parameter to get that num'th page of results. Looks like combining this with order=ASC&orderby=date should allow full in-order import (over several pages) if you're doing this programmatically.