Saturday , February 22 2025

Webmaster notes

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 »

301 redirect in PHP

There are different reasons for different engines to add 301 redirects not in .htaccess. For DLE, PHP redirects are the only way to avoid looking at dynamic garbage generated in links. Examples implementation in PHP: if ( getenv('REQUEST_URI') == '/page-before-redirect/' ) { header( "HTTP/1.1 301 Moved Permanently" ); header( "Location: …

Read More »

Correct transfer Drupal site from http to https

The certificate was purchased and activated, the site with https does not open correctly. The way to solve this problem: 1. In the file sites/default/settings.php find the line with $base_url. Under this line add: $conf['https'] = TRUE; $base_url = 'https://old.domain.com'; Replace the domain name with the actual one, and do …

Read More »

How to remove generator in Drupal 7

By default, the source code of Drupal sites contains the line <meta name=”generator” content=”Drupal 7 (http://drupal.org)” /> To remove it, you need to edit the file /sites/all/themes/mytheme/template.php (instead of mytheme, go to your site’s theme folder), find function shop_adaptive_html_head_alter and add before the closing character } this line: unset($head_elements['metatag_generator_0']); If …

Read More »