Title: Bug? Invalid html
Last modified: November 18, 2019

---

# Bug? Invalid html

 *  [Nonverbis](https://wordpress.org/support/users/nonverbis/)
 * (@nonverbis)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/bug-invalid-html/)
 * Version 2.7.0
 * The problem: code is not valid.
 * [https://validator.w3.org/](https://validator.w3.org/) shows error:
 *     ```
       Error: CSS: Parse Error.
   
       At line 141, column 24
   
       ype="text/css">0</style><link 
       ```
   
 * file: register-settings.php
 * Starting from line 36:
 *     ```
       	if ( is_null( $default ) ) {
       		$default = crp_get_default_option( $key );
       	}
       ```
   
 * If custom_css has not been set, $default equals to 0 here. Offtopic: I don’t 
   know what custom_css is about.
 * In line 51 $value becomes also 0.
 * And this 0 goes directly to the html code, which results in invalidness. In this
   case $value must be an empty string instaed of 0.
 * I fixed like this in functions.php of my theme:
 *     ```
       // Fix bug in contextual related posts {
       function ved_crp_get_option_custom_css($value){
           return (0 ===  $value ? "" : $value);
       }
   
       add_filter( 'crp_get_option_custom_css', 'ved_crp_get_option_custom_css' );
       //} Fix bug in contextual related posts
       ```
   
 * Please, correct the code.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/bug-invalid-html/#post-12168102)
 * custom_css is the cost code textarea in the settings page. If the area is blank
   and then you save th epage, it should save the option properly. Can you please
   check the Styles tab to see what you have there?

Viewing 1 replies (of 1 total)

The topic ‘Bug? Invalid html’ is closed to new replies.

 * ![](https://ps.w.org/contextual-related-posts/assets/icon-256x256.png?rev=2985705)
 * [Contextual Related Posts](https://wordpress.org/plugins/contextual-related-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contextual-related-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contextual-related-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/contextual-related-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contextual-related-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contextual-related-posts/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/bug-invalid-html/#post-12168102)
 * Status: not resolved