By default, many web browsers will open files like .js and other text-based files in a new tab. However, if you want users to be able to download these files directly, such as you might with .zip files, you can easily achieve this by adding the download attribute to your …
Read More »Webmaster notes
How to recursively change a word in all site files
When managing a website, you may encounter situations where you need to replace a specific word or domain across multiple files. This task can arise for various reasons, such as updating outdated content, rebranding, or correcting errors. Fortunately, you can achieve this efficiently by using command-line tools to recursively find …
Read More »How to display another image preview for the particular language version
I need to use another image for the K2 article for the another lang. For example, we have 2 languages used for the site: en (by default) and additional pl. In the administrator UI we can edit only general image preview. I made some edits to use another image for …
Read More »How to disable click on links using CSS?
Easy question, easy solution. We can disable click on all links, or we can use id or class for the particular links that should be unlickable and use: pointer-events: none; I use it for the case when I need to disable clicks on the images to avoid popup windows on …
Read More »How to disable top panel (Toolbar) on the WordPress frontpage
The solution is so easy to follow. There is no need to edit CSS or theme files. You need to go to the Wp admin, then go to the Users > Your Profile. Scroll down to Toolbar (under Keyboard Shortcuts) and uncheck the Show Toolbar when viewing site box.
Read More »How to open html pages without .html
If your site uses links like http://domain.com/testpage.html and http://domain.com/demo.html, and you want them to open like http://domain.com/testpage and http://domain.com/demo, you can use this solution. Go through FTP or a File Manager to the folder with the site files. Open file .htaccess and add the following code: RewriteEngine on RewriteBase / …
Read More »Display the date + a few days from the current one
The task in short: you need to make the delivery date + 5 days from the current date in PHP, with the output of the month in the genitive case in RU. But you can ignore custom edits for that language version. The method with date( ‘d FY’ ); is …
Read More »How to remove h3 from AAPF – Advanced Ajax Product Filters (Rocket)
This article is about how to remove unused h3 tags, but not completely – just replace them to div tags. To solve this problem, you need to add this code to functions.php: add_filter('BeRocket_AAPF_template_full_content', 'some_custom_berocket_aapf_template_full_content', 4000, 1); add_filter('BeRocket_AAPF_template_full_element_content', 'some_custom_berocket_aapf_template_full_content', 4000, 1); function some_custom_berocket_aapf_template_full_content($template_content) { $template_content['template']['content']['header']['content']['title']['tag'] = 'div'; return $template_content; }
Read More »Css styles for WordPress admin in functions.php
If you need to add individual styles, and they are only a couple of lines, you can add them directly to functions.php: add_action('admin_head', 'webinp_style'); function webinp_style() { print '<style> tr[data-slug="to-top"] {display: none !important;} </style>'; } Between <style> and <style> you need to write your own CSS styles.
Read More »Color change for placeholder in input not working
By default, gray font is displayed, which does not blend well with a dark background. If in css it is easy to change the background for the input, then I had to find a solution for the text color in the placeholder. This example helped me solve the problem (the …
Read More »