Why are some SVG-images not visible in my footer?

Not sure if you’ve already done this, so forgive me if I’m telling you something you already know. But WordPress doesn’t support SVG Uploads out of the box, so to speak. This is due to security issues that can be created when a user uploads SVGs with malicious code. Mainly, a problem if you let … Read more

WordPress search form and input type=”image”

You have to use javascript or jQuery for this form. You can use like this: <!– Custom Style for the form –> <style type=”text/css”> body { margin: 0; padding: 30px 0; font-family: arial; font-size: 16px; line-height: 22px; max-width: 800px; margin: 0 auto; overflow: hidden; } body:after { content: ”; clear: both; display: table; } img{ … Read more

Enable CORS for getting an inline SVG by URL

By using custom rewrite_url, I was able to hijack the request and set its CORS-friendly headers. class Cors_Media { const QUERY_VAR = ‘cors_media_id’; public function init() { add_action(‘init’, [$this, ‘add_rewrite_rule’]); add_filter(‘query_vars’, [$this, ‘query_vars’]); add_action(‘template_redirect’, [$this, ‘template_redirect’]); } public function query_vars(array $qs) { $qs[] = ‘cors_media_id’; return $qs; } public function add_rewrite_rule() { add_rewrite_rule( ‘^cors_media_id/([0-9]+)/?’, ‘index.php?cors_media_id=$matches[1]’, … Read more

import svg-files from wxr – (upload works, import not)

Found my solution after a little more digging. The problem lies in wordpress-importer Found this from jan 30 on github: https://github.com/WordPress/wordpress-importer/issues/47?_pjax=%23js-repo-pjax-container Then later the solution here: https://www.playnicetogether.com/2015/11/07/wordpress-importer-plugin-content-length-problem-solved/ “the WordPress Importer plugin is not compatible with remote servers that use HTTP compression.” For WordPress v4.6 and above, please use the following: add_filter( ‘http_request_args’, function( $r, $url … Read more

Expected an identifier and instead saw ‘

If you use JSX in your code, then you need to build the script before using it on “standard” WordPress sites where JSX is not available. So, Either build the script.. Or (looking at your code, it’s probably easier to just) use (ES5 with) wp.element.createElement() and not JSX: var MyIcon = function () { var … Read more

WordPress Block.js SVG createElement

Basically, when using wp.element.createElement(), For attribute names having special characters like a hypen/-, the name should be put in single/double quotes: e.g. ‘data-name’ and not simply data-name. createElement( ‘svg’, { ‘data-name’: ‘Layer 1’ // like this data-name: ‘Layer 1’ // not this } ); The same also goes to attribute names like class which is … Read more

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