WordPress

WordPress: get author info / user details from post id

Some times we needed to pull out the author data from a post id. It is very easy do it in wordpress. It can be accomplished by the_author_meta() function or get_the_author_meta() function. You will need call this function in your theme or plugin, through a hook. the_author_meta() –> Outputs the data, just like echo get_the_author_meta() -> holds the …

WordPress: get author info / user details from post id Read More »

CORS policy: No ‘Access-Control-Allow-Origin’

Font from origin domain.dev has been blocked… (CORS and browsersync) If you are getting issue fonts are blocked in web client CORS then below code will help you. Use the code in .htaccess file and problem will be resolved 🙂 # Allow access from all domains for webfonts. <IfModule mod_headers.c> <FilesMatch “\.(ttf|ttc|otf|eot|woff|woff2|font.css|css)$”> Header set Access-Control-Allow-Origin “*” …

CORS policy: No ‘Access-Control-Allow-Origin’ Read More »

Redirect all url to https

If you have a secure certificate (SSL) on your website, you can automatically redirect visitors to the secured (HTTPS) version of your website to make sure their information is protected. Using the following code in your .htaccess file automatically redirects visitors to the HTTPS version of your site: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] …

Redirect all url to https Read More »