Inserting article:tags meta in html head-element, using get tags, no wp_head

Okay, so after some more tinkering, I found another solution. This one works with or without the loop. So adding it in the template file or your single.php is fine, in the <head> of the HTML. <?php $tags = get_the_tags($post->ID); ?> <?php foreach($tags as $tag) : ?> <meta property=”article:tag” content=”<?php print_r($tag->name);?>” /> <?php endforeach; ?> … Read more

How to add meta tags inside single image page?

Probably because when the execution is hitting your code is already too late to hook on wp_head. If you want to have your code in image.php, make sure you place it before get_header(). In any case, I would move the code to functions.php or dedicated file and maybe use is_attachment() to conditionally print the meta … Read more

Add function to head “no product found”

It’s better to use PHP to remove things when possible, because if you just use JS, they’re still technically there on the page. What if a visitor is on a slow-loading network and the JS doesn’t kick in for a long time, so they see the filters long enough to use them? If you can … Read more

Remove style tags from head

My solution removes now all <link></link> tags and <style>@import url()</style> googleapi entries in the given HTML: add_action( ‘wp_footer’, ‘SPDSGVOPublic::removeGoogleFonts’ ); /** * Remove all occurrences of google fonts */ public static function removeGoogleFonts() { ob_start(); $content = ob_get_clean(); $patternImportUrl=”/(@import[\s]url\((?:”|\”)((?:https?:)?\/\/fonts\.googleapis\.com\/css(?:(?!\1).)+)(?:”|\’)\)\;)/’; $patternLinkTag = ‘/<link(?:\s+(?:(?!href\s*=\s*)[^>])+)?(?:\s+href\s*=\s*([\'”])((?:https?:)?\/\/fonts\.googleapis\.com\/css(?:(?!\1).)+)\1)(?:\s+[^>]*)?>/’; preg_match_all($patternImportUrl, $content, $matchesImportUrl); preg_match_all($patternLinkTag, $content, $matchesLinkTag); $matches = array_merge($matchesImportUrl,$matchesLinkTag); foreach( $matches as $match … Read more

Custom page with WP Header showing Page not found title

ok so I figured this out. Here are the steps I took Create a php file in your themes directory wordpress Dir -> Themes -> YOUR THEME NAME -> newfile.php In this file add the following: <?php /* Template Name: theme-child */ ?> <?php get_header(); ?> // your custom script here <?php get_footer(); ?> **Then … Read more

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