restore wordpress widdget from database backup

If you wish to restore wordpress text widget from backup you need to follow those steps

1. Copy content from wp_options of the widget for example option_name=widget_text

2. Paste it on the new site

3. Restore all widgets on positions – copy sidebars_widgets value. This value contain all widgets positions

С етикет: , , ,
Публикувано в php, wordpress

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource

If you have following error

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at

Then you need to add some lines to your .htaccess file

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

Header add Access-Control-Allow-Origin „*“
Header add Access-Control-Allow-Headers „origin, x-requested-with, content-type“
Header add Access-Control-Allow-Methods „PUT, GET, POST, DELETE, OPTIONS“

RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

С етикет: , , , ,
Публикувано в Joomla, linux, wordpress

windows 10 disable fastboot

Sometimes you need to disable FastBoot on laptop on which you don’t have such option in the BIOS

To do it you can modify following registry key

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power

HiberbootEnabled DWORD

0 = Turn off fast startup
1 = Turn on fast startup

С етикет: , , , , , ,
Публикувано в Без категория

wordpress forse css styles version

Sometime css files version need to be set so update to be forced on all users which are visiting the site

This can be done very easy in wordpress just need to add those lines in function.php of the theme

function my_wp_default_styles($styles)
{
	//use release date for version
	$styles->default_version = "20160714";
}
add_action("wp_default_styles", "my_wp_default_styles");
С етикет: , , , ,
Публикувано в wordpress

Redirect all php files to wordpress posts or strip .php extension

If you need to redirect your old urls which are like

alabala.com/see-this-post.php to alabala.com/see-this-post/

You can use this simple .htaccess redirect

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)\.php$ /$1/ [l,R=301,NC]

С етикет: , , ,
Публикувано в wordpress