Saturday , February 22 2025

iryna

Hi there! My name is Iryna, I am a web developer from Ukraine. While working on freelance projects I often face different technical issues and in this blog I publish articles on how to solve them. I am also interested in digital drawing and in this blog you will find brief tutorials that helped me and hopefully can help you as well.

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 »

How to remove “Category:” in the title of the article category

This issue is relevant if the title was added using the_archive_title();. To remove the extra phrase “Category:”, you need to use the hook: add_filter( 'get_the_archive_title', 'lets_remove_name_category' ); function lets_remove_name_category( $title ){ if ( is_category() ) { $title = single_cat_title( '', false ); } elseif ( is_tag() ) { $title = …

Read More »

How to display h1 in WordPress theme

This task is relevant for cases when developers in custom templates for some reason decide not to display the page title, although according to all SEO requirements it should be, and should be wrapped in h1. Heading Examples 1. In the page template: in the page.php of your theme, add …

Read More »

Visualcomposer – error array_search() expects parameter 2 to be array, null given (ContentUrlReplaceController.php)

This error appeared after the transfer of the site to another domain. Due to this error, there is no access to /wp-admin, and this error is displayed on the site above the content: Warning: array_search() expects parameter 2 to be array, null given in /wp-content/plugins/visualcomposer/visualcomposer/Modules/FrontView/ContentUrlReplaceController.php on line 68 The error …

Read More »