Friday , December 20 2024

Wordpress

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

How to add custom CSS for WordPress admin panel

If you need to place a few CSS lines for the admin panel, then edit the file functions.php at the root of the theme, and add it to the end of the file: add_action('admin_head', 'admin_styles'); function admin_styles() { echo '<style> .update-nag {display: none !important;} </style>'; } Instead of the .update-nag …

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 »

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 »