Saturday , February 22 2025

Wordpress

Wordpress – articles, how-to-fix notes, fast solutions

On_sent_ok not working in Contact Form 7

If your site uses the old version of WordPress and the Contact Form 7 plugin, it is enough to use the code in the Advanced settings tab: on_sent_ok: "yaCounterXXXXXXXX.reachGoal('mygoal');" Where XXXXXXXX is the counter ID in Yandex Metrika, mygoal is the name of the goal that was previously created in …

Read More »

Service tags for Contact Form 7

The most common question is “How to find the Contact Form 7 url of the page from which the form was filled out?” Here is a list of service tags that can help you get data about the user who filled out the form: [_remote_ip] Sender's IP address [_user_agent] User …

Read More »

Perfect robots.txt for WordPress

In this article I have posted 2 examples – simple and advanced. In each example there will be lines that you need to change, below there will be notes with specifics of what should be changed. 1st robots.txt, optimized for SEO User-agent: * Disallow: /cgi-bin Disallow: /? Disallow: /wp- Disallow: …

Read More »

How to display a product attribute anywhere in Woocommerce

With this code, you can display a product attribute in the template, for example, “size”. global $product; echo $product->get_attribute('size'); Below I publish a method for displaying a property with an additional icon output, if this property is filled in: <?php $subheadingvalues = get_the_terms( $product->id, 'pa_time'); if ($subheadingvalues): ?> <div class="labeltime"><i …

Read More »

How to display product SKU in Woocommerce product card

As it often happens, we do not need product SKU where it is placed in the template. To display in the right place, use this code: <?php echo '' . $product->sku . ''; ?> When I published this code on a test project (in /woocommerce/single-product/short-description.php) as a result, the product …

Read More »