天道酬勤,学无止境

related-content

WooCommerce - 按标签和类别分类的相关产品(WooCommerce - related products by tags and categories)

问题 我想根据标签在我网站的每个产品页面中显示 8 个“相关产品”。 但如果结果少于 8 个,则用相同类别的产品填补空白。 这是我用于仅显示与标签相关的产品 ( functions.php ) 的代码: //New "Related Products" function for WooCommerce function get_related_custom( $id, $limit = 5 ) { global $woocommerce; // Related products are found from category and tag $tags_array = array(0); $cats_array = array(0); // Get tags $terms = wp_get_post_terms($id, 'product_tag'); foreach ( $terms as $term ) $tags_array[] = $term->term_id; // Get categories (removed / commented) /* $terms = wp_get_post_terms($id, 'product_cat'); foreach ( $terms as $term ) $cats_array[] = $term->term_id; */ //

2021-06-22 04:54:53    分类:技术分享    php   wordpress   woocommerce   related-content

Google的相关搜索查询有可用的API吗?(Is there an API available for Google's Related Search Queries?)

问题 当我在google.com上搜索“ Clooney时,在底部建议了一些相关的搜索查询: Searches related to clooney clooney movies clooney girlfriend rosemary clooney nick clooney clooney oscar obama clooney clooney fundraiser betty clooney 我想以编程方式接收单个或一个关键字列表的列表。 有没有这样的API? 回答1 不幸的是,谷歌已经淘汰了相关查询API。 虽然有相似和半相似的API。 我不隶属于任何一个,也没有使用过任何一个。 Sametimeweb提供了一个API,用于查找与传递的域相似的域。 它与搜索词不同,但是如果您知道要比较的域,则可以选择。 它不是免费服务。 另一个付费服务来自KeywordDiscovery及其相关的关键字。 雅虎! 提供相关的搜索服务。 它不是免费的,每个查询将返回10个结果。 这是其BOSS搜索产品的一部分。 回答2 否,Google没有任何可用于以编程方式检索相关URL列表的公共API。 但是,如果您可以选择其他方法,那么Bing拥有一个用于类似目的的公共API: http://api.bing.com/osjson.aspx?query=clooney 回答3 Freebase

2021-05-24 15:35:49    分类:技术分享    google-search   related-content

WooCommerce - related products by tags and categories

I want to display 8 "related products" in every product page of my site based on tags. But if there are less than 8 results fill the gaps with products in the same Categories. Here is code that I'm using for showing only tag-related products (functions.php): //New "Related Products" function for WooCommerce function get_related_custom( $id, $limit = 5 ) { global $woocommerce; // Related products are found from category and tag $tags_array = array(0); $cats_array = array(0); // Get tags $terms = wp_get_post_terms($id, 'product_tag'); foreach ( $terms as $term ) $tags_array[] = $term->term_id; /

2021-05-11 01:06:01    分类:问答    php   wordpress   woocommerce   related-content

Is there an API available for Google's Related Search Queries?

When I search for Clooney at google.com a number of related search queries are suggested at the bottom: Searches related to clooney clooney movies clooney girlfriend rosemary clooney nick clooney clooney oscar obama clooney clooney fundraiser betty clooney I would like to receive this list programmatically for a single or a list of keywords. Is any such API available?

2021-04-23 16:11:27    分类:问答    google-search   related-content