Swap SVG icons in child themes

I see that both icon arrays ($ui_icons and $social_icons) in Twenty Nineteen can be accessed publicly, so I managed to replace any icon via the init hook in a child theme. An example: function child_init() { TwentyNineteen_SVG_Icons::$social_icons[‘instagram’] = ‘<svg>… Insert new Instagram icon SVG code here …</svg>’; } add_action( ‘init’, ‘child_init’ );

SVG Upload to WordPress Issue

I’ve established this is a plugin/theme conflict. I will report back when I know more. I tested this on a couple of my other client’s websites that are on different servers but share similar themes/plugins, and sure enough, I can upload SVGs.

SVG icons in Twenty Nineteen

You shouldn’t need to change the viewbox attribute. You can probably just use it. The way I think about is SVGs are like they are drawn on graph paper. The viewbox sets out how many squares there are on the paper and the the path in your examples above are the guides to where to … Read more

SVG upload does not work

WordPress doesn’t allow to upload SVG files by default. Add svg file type in allowed file types list function wp_mime_types($mimes) { $mimes[‘svg’] = ‘image/svg+xml’; return $mimes; } add_filter(‘upload_mimes’, ‘wp_mime_types’); Fix for displaying svg files in media library function wp_fix_svg() { echo ‘<style type=”text/css”> .attachment-266×266, .thumbnail img { width: 100% !important; height: auto !important; } </style>’; … Read more

Replace custom SVG icons in Twenty Twenty-One

That’s not how that file works, and including it will just load the class definition, it won’t create a Twenty_Twenty_One_Child_SVG_Icons object or override Twenty_Twenty_One_SVG_Icons. It’s also not how child themes work. Child themes let you override templates specifically, not arbitrary files and classes. Instead, use the twenty_twenty_one_svg_icons_{$group} filters to modify the array in your child … Read more

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