Adding to fontawesome-webfont.woff2 to boost website speed

If your theme is any good it will use wp_enqueue_style to include fonts in the head of your site. This gives you access to the style_loader_tag filter, which you can use to modify the html of the font link. Like this: add_filter( ‘style_loader_tag’,’wpse366869_preload_styles’, 10, 4 ); function wpse366869_preload_styles( $html, $handle, $href, $media ) { // … Read more

Is there a way to avoid 404 pages in WordPress?

One way to do this is to use the status_header filter. Adding the following to the functions.php file or your theme (or an appropriate plugin file) would do the trick: add_filter( ‘status_header’, ‘your_status_header_function’, 10, 2 ); /** * Substitutes a 202 Accepted header for 404s. * * @param string $status_header The complete status header string … Read more

Using google graph api with wordpress

You should run updatepage() function after loading the google jsapi script. try jquery ready inside updatepage like this: function updatepage(){ // this line added by me jQuery(document).ready(function ($) { // Load the Visualization API and the piechart package. …. …. chart.draw(data, options); } } or you can see this shortcode code plugin for simple chart … Read more

Adding JSON Structured Data to WordPress

If you’re creating the theme yourself, you can always use Schema Microata markup directly in the theme itself. As we can see in the below example, adding extra attributes to your HTML can make it Schema compliant. In this instance, we are using itemscope, itemtype and itemprop: Taken from http://schema.org/docs/gs.html#microdata_how <div itemscope itemtype =”http://schema.org/Movie”> <h1 … Read more

Disallow author with robots.txt

If you use Yoast SEO, you can go to Users > All Users, and in the Yoast SEO settings, check Do not allow search engines to show this author’s archives in search results. See this link. OR With robots.txt, you can add: User-agent: * Disallow: /author/* OR You can also add the robots meta-tag to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)