• Nonverbis

    (@nonverbis)


    Version 2.7.0

    The problem: code is not valid.

    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

    (@ajay)

    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.