As you know, with styled-component you may extend an HTML tag and define an attribute immediately. That’s very useful when you need to use a component often.
Category / Very Short Snippet
Of course, you know dangerouslySetInnerHTML attribute. This is very useful when you need to insert a custom own HTML in your page. …is React’s replacement for using innerHTML in the browser DOM. In general, setting HTML from code is risky because it’s easy to inadvertently expose your users to a cross-site scripting (XSS) attack. So, you […]
Edit your wp-config.php file, located in WordPress root folder, and add or replace define(‘WP_DEBUG’, true); In this way, WordPress will print the logs on the screen. This may be very annoying, so you would like to redirect all logs in a file. As usual, please don’t hesitate to leave any questions or comments in the […]
How to check if an element DOM exists Be careful when you wish if an element DOM exists. If you use: This method doesn’t work because jQuery will return an [Object object] even if the element doesn’t exist. We may use a couple of methods to be sure that an element exists:
In WordPress, you can organise the category with a relationship parent/child. This means that a single post belongs to multiple categories. Let’s see how to get the parent category of a post: