woocommerce – Show all products that are tagged with the current product's tags

I am trying to achieve functionality where certain products in my WooCommerce shop have a specific (only a single) tag – multiple products of a similar type can have the same tag.

I am trying to ensure that when a product is displayed, all other products with a similar tag are shown in the selected position. So far I have managed to display all products with tags on the single product page, but I cannot filter to display the products with the tags that match the tags of the current product.


I am on an Okley 3008 Black product with the tag: Okley 3008

2 other products have the same label, i.e. H. Okley 3008

So a total of 3 products were displayed, but all products are currently displayed on the product page (see below in the shopping cart in the dropdown list (currently defective) and thumbnails).

So I want help when I look at Okley 3008. All products with the Okley 3008 tag should be displayed instead of all products with different tags.

Here is my code:

Function woo_products_by_tags_shortcode ($ atts, $ content = null) {
global $ post;
global $ product;
$ product_attributes = $ product-> get_attributes ();

// get attributes
extract (shortcode_atts (array (
"tags" => "http://wordpress.stackexchange.com/"
), $ product_attributes));

ob_start ();

// Define query arguments
$ args = array (
& # 39; # 39 & post_type; => & # 39; product & # 39 ;,
& # 39; # 39 & posts_per_page; => 5,
& # 39; # 39 & product_tag; => $ tags

// Create a new query
$ loop = new WP_Query ($ args);

// Get the product number
$ product_count = $ loop-> post_count;

// If results
if ($ product_count> 0):

Echo & # 39;& # 39 ;;


_e (& # 39; No product that meets your criteria. & # 39;);

endif; // endif $ product_count> 0

if ($ product_count> 0):

Echo & # 39;

& # 39 ;;
// start the loop
while ($ loop-> have_posts ()): $ loop-> the_post (); global $ product;

global $ post;

if (has_post_thumbnail ($ loop-> post-> ID))
Echo & # 39;

& # 39 ;;
Echo & # 39;

plugin_url (). & # 39; / assets / images / placeholder.png "alt =" http://wordpress.stackexchange.com/ "/>

& # 39 ;;

in the meantime;

Echo & # 39;

& # 39 ;;


_e (& # 39; No product that meets your criteria. & # 39;);

endif; // endif $ product_count> 0

return ob_get_clean ();


add_shortcode ("woo_products_by_tags", "woo_products_by_tags_shortcode");

I use the following code in functions.php to display products

add_action (& # 39; woocommerce_single_product_summary & # 39 ;, & # 39; add_custom_related_product_by_tags & # 39 ;, 15);
Function add_custom_related_product_by_tags () {
global $ product;
$ product_attributes = $ product-> get_attributes ();
echo do_shortcode (& (39; (woo_products_by_tags tags = "http://wordpress.stackexchange.com/". $ product_attributes. "http://wordpress.stackexchange.com/")');

Problems with the current host provider – New hosting proposal

Hello, for the past 5 days I was serious because my hosting provider provided me with a dedicated server with unlimited storage and 32 GB of RAM. The server was up and running five times 5 days ago when an entire server went down. In trouble with my customers, even I was arrested for it. I have been asked to go to their website or to allow them to broadcast their website. But every time I contact my host, I keep getting excuses like we're working on your server. In the past 5 days I can't go on like this.

Here is the message I received.

Day 2..

Dear Sir,

Please note that we treat you with great respect.

Further checks found that there was a problem with the Apache and network configuration files. In this case, the websites will not work. Now we have corrected the configuration mismatch on our part. All websites hosted on your server will now work their end and try to access the websites with no problems. Our server team also continuously monitors the server. If we find any problems, we will update them.

** Now after this messaging server shuts down in the next few minutes. When I send a message, I keep hearing that our team is working on it.

Day 4 …..

Dear Sir,

Please note that the server is working properly. We noticed that there is a problem with network routing at the upstream provider level. We continuously check this with them. It will take some time for the problem to be resolved. As soon as we receive an update from you, we will update you.

*** Server has failed in the next few minutes
Today I talked to her. They told me the server was with their abuse team that there was a DDoS attack on my server. As soon as the abuse team has finished with my server, I will be unsure of your decision.

Please don't just understand, I'm also under serious pressure from my customers. If there is something that is not right, tell me, is this problem from my end too? What action can I take now and lastly I need a better hosting provider.

What is the current meta description length in Google Serp?

To set an exposed filter to show nodes that the current user has not commented on

I am trying to create an exposed filter in which the current user can choose whether to display all nodes or only those that the current user has not commented on. I tried the context filter & # 39; Comment: Comments of the node & # 39; and & # 39; Comment: Author & # 39 ;, & # 39; Comment: Author UID & # 39; (without default). Then a filter criterion & # 39; Comment: Author UID & # 39; added, where the grouped filter was set up using the token (current user: UID). It did not work.

rust – Finds a file in current or parent directories

As a Rust beginner, I would like to know how I can improve the following points considering the following function:

  • handling Path and PathBuf type correctly;
  • Performance;
  • Rust writing style in general.

Here is the function, decorated with a complete working example:

use std::env;
use std::path::{Path, PathBuf};

const RUSV_FILENAME: &str = ".rusv.json";

 * Find a rusv file in the current or parent directories of the given directory.
fn find_rusv_file(starting_directory: &Path) -> Option {
    let mut directory = starting_directory;
    let rusv_filename = Path::new(&RUSV_FILENAME);

    loop {
        let filepath: PathBuf = (

        if filepath.is_file() {
            return Some(filepath);

        match directory.parent() {
            Some(parent) => directory = parent,
            None => return None,

fn main() -> std::io::Result<()> {
    let path = env::current_dir()?;

    match find_rusv_file(&path) {
        Some(filepath) => println!("Rusv file was found: {:?}", filepath),
        None => println!("No rusv file was found."),


My question is Not About:

  • Create a more general function (e.g. by specifying the file name as an argument);
  • Everything related to the main() Function.

Current best practices / attitudes?

The sticky thread looks like it's a few years old now?

If I just wonder if there is a current thread or post that someone can refer me to, I get the current 80/20 best practices / settings for gsa.

Is Serengines currently the best option for more platforms to post what gsa has internally?

What should I combine with gsa captcha breaker to get the most money for solving captchas? Especially for the better contextual platforms.

Any other settings or tips for the current software and SEO landscape would be great.

thank you all