Leroy12
Forum Replies Created
-
I found the issue ! I had a space after “?>” at the end of functions.php. The problem and solution is explained at ajax – WordPress: custom field display twice – WordPress Development Stack Exchange
Thanks Shivam.
You’re right. With a fresh install, I do not have any problem. I’ll try to locate the problem in my code base. The challenge is that I do not have any error reported (at least in the browser console).
Hi @whiteshadow01 thanks for your answer. I’m not using any 3rd party plugin. The metabox needs to be enabled via “Gutenberg / Preferences / Custom Fields” This is the “custom fields” metabox I’m referring to:
Thanks
Forum: Developing with WordPress
In reply to: Add appearance tools to Classic themesThanks for those pointers, @threadi, very helpful !
Forum: Fixing WordPress
In reply to: Copy-pasting images creates PNG images, not JPGThanks James.
I could indeed export the finished file in Photoshop, but that would really slow down my workflow.
Instead I’ve added the following piece of code in functions.php, so that when I copy/paste a PNG, it is converted into JPG.
add_filter('wp_handle_upload_prefilter', 'convert_pngs_to_jpgs'); function convert_pngs_to_jpgs($file) { $filename = $file['name']; $extension = pathinfo($filename, PATHINFO_EXTENSION); if (!in_array($extension, ['png'])) { return $file; } $image = imagecreatefrompng($file['tmp_name']); $bg = imagecreatetruecolor(imagesx($image), imagesy($image)); imagefill($bg, 0, 0, imagecolorallocate($bg, 255, 255, 255)); imagealphablending($bg, TRUE); imagecopy($bg, $image, 0, 0, 0, 0, imagesx($image), imagesy($image)); imagedestroy($image); imagejpeg($bg, $file['tmp_name'], 100); imagedestroy($bg); $file['name'] = preg_replace('/\.[^.]+$/', '.jpg', $filename); return $file; }Forum: Plugins
In reply to: [PNG to JPG] How to force PNG2JPG to reevalute the list of PNG filesThanks Kubiq. I found out that the plugin didn’t resize some PNGs (so still in my folder) but updated the database entries to JPG. I guess this is because I have 10,000+ PNGs to resize… Thanks anyway.
Forum: Plugins
In reply to: [PNG to JPG] How to force PNG2JPG to reevalute the list of PNG filesThanks for your fast answer!
When I reload the βconvert existing PNGsβ tab, I don’t see many PNG images that are on my hard drive, and referenced in the media library, hence my question.
I wondered if there was some tables or metadata or temp data used by your plugin, that I could delete, to make sure the plugin does reevaluate the entire media library.
Forum: Everything else WordPress
In reply to: How to paste HTML into Gutenberg editor?Found my solution:
- I created a HTML page, with my HTML snippets.
- On Windows: Viewing the page on a browser, I copied each snippet independantly.
- Windows Key + V to open the Windows Clipboard Manager – and for each snippet, I pinned it.
- From WordPress, when I need to paste a HTML snippet, Windows Key + V to trigger the Clipboard, click on the snippet and it is directly embedded into WordPress.
Thanks
Forum: Everything else WordPress
In reply to: How to paste HTML into Gutenberg editor?Thanks George. That does work, but I want to embed those HTML snippets into some text I’m writing in Paragraph or Quote blocks. Thanks.
Forum: Fixing WordPress
In reply to: Adding a CSS to links of Image GalleryHi Sahil,
Thanks very much for your answer – I didn’t know the option existed in the UI of Gutenberg!I also realize my question was not clear. Would you know of a way to add such custom class programmatically? So that it would apply on all image galleries automatically.
If it’s in the UI, there must be a hook to add it, but I can’t find it.
Thanks again
NicolasForum: Plugins
In reply to: [Gutenberg] Nested H2, H3 in Blockquotes with Gutenberg?Thanks Jorge !
Forum: Developing with WordPress
In reply to: Custom post types, Gutenberg & tags (2)Problem solved, thanks to https://github.com/WordPress/gutenberg/issues/19388 .
I hadn’t put my register_post_type calls into an “init” hook… My custom post types were working fine, except for the Categories / Tags metaboxes not appearing in the admin !!!
Wouldn’t have found a solution by myself, and a nice lesson that reading documentation in detail helps π
Forum: Developing with WordPress
In reply to: Custom post types, Gutenberg & tags (2)Thanks @sterndata for your pointer. I would say my use case is simpler (not using a custom taxonomy, but the default “post_tags” one); and I’m not seeing any 400 issues as mentioned in the github page.
I have anyhow created a bug request at https://github.com/WordPress/gutenberg/issues/19388
Worth adding : I have manually added a tag to some instances of my custom post types, and I can retrieve them in my theme. So it really seems like a UI / Gutenberg related issue.
Thanks Joy – it works like a charm ! I have to start thinking about searching for “block” in the codex ! Thanks a lot.
Forum: Developing with WordPress
In reply to: Custom post types, Gutenberg & tagsHi @bcworkz
Thanks very much for the tip regarding flush_rewrite_rules() ! Something I didn’t know !Regarding Tags : in the list of supported Options for my custom post types, Tags are not available π
I’m using WordPress 5.1.1
Is there anything that I can check / alter in the WP database, that defines what taxonomies are available for a custom post types ?
Thanks