Saturday , February 22 2025

Articles

If the link contains another domain/subdomain

The task is relevant if hosting subdomains refer to the root of the main site, or if several domains are registered as aliases to each other. If you need to write noindex/nofollow etc., you can simply write a condition in index/header section: <?php $host = $_SERVER['HTTP_HOST']; if($host == "old.domain.com" or …

Read More »

How to change 302 to 301 redirect in Opencart

By default, OpenCart automatically enables 302 redirects. However, using 302 redirects is not ideal for SEO purposes because they indicate a temporary redirect. For better search engine optimization, it’s important to use 301 redirects, which signify a permanent move. This article provides a step-by-step guide on how to change 302 …

Read More »

How to display search form in WordPress theme

First you need to check if the file searchform.php exists in the root of the site theme. The content of this file should be like this: <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ) ?>" > <label class="screen-reader-text" for="s">Search: </label> <input type="text" value="<?php echo get_search_query() ?>" name="s" id="s" /> …

Read More »

Anchor link and smooth transition

This case is used for landing pages, for pages with a lot of content. The default anchor link looks like this: <p><a href="#mylink">Anchor link </a></p> <div id="mylink"></div> Sometimes, instead of <div id=”mylink”></div> this code <a name=”mylink”></a> is used, the result will be the same, but w3c validators will complain about …

Read More »

How to change text for Add to Cart button for Woocommerce

This task can be solved by editing the translation files of your theme. But you can use a hook that allows you to rename the “Add to Cart” button faster. In the file functions.php add the following code: add_filter( 'woocommerce_product_single_add_to_cart_text', 'tb_woo_custom_cart_button_text' ); add_filter( 'woocommerce_product_add_to_cart_text', 'tb_woo_custom_cart_button_text' ); function tb_woo_custom_cart_button_text() { return …

Read More »