Posts

Showing posts with the label customization

How to force use https insted of http for all javascript js file or stylesheet css files in wordpress

Just copy and paste below code into your theme's functions.php file add_action('wp_print_scripts', 'rj_force_ssl_scripts', 100); add_action('wp_print_styles', 'rj_force_ssl_styles', 100); function rj_force_ssl_scripts() {     if (!is_admin()) {         if (!empty($_SERVER['HTTPS'])) // or you can also use is_ssl() function for check ssl         {             global $wp_scripts;             foreach ((array) $wp_scripts->registered as $script) {                 if (stripos($script->src, 'http://', 0) !== FALSE)                     $script->src = str_replace('http://', 'https://', $script->src);             }         }     } } function rj_force_ssl_styles() {     if (!is_admin()) {   ...

How to add wordpress wysing editor to post category's description textarea

First need to remove html tag remove filter from description value by bellow filter description will accepts html content also remove_filter( 'pre_term_description', 'wp_filter_kses' ); remove_filter( 'term_description', 'wp_kses_data' ); for add wysing editor to category description just copy and past below class class Visual_Term_Description_Editor { public $taxonomies; public function __construct( $taxonomies ) { /* Setup the class variables */ $this->taxonomies = (array) $taxonomies; /* Only users with the "publish_posts" capability can use this feature */ if ( current_user_can( 'publish_posts' ) ) { /* Remove the filters which disallow HTML in term descriptions */ remove_filter( 'pre_term_description', 'wp_filter_kses' ); remove_filter( 'term_description', 'wp_kses_data' ); /* Add filters to disallow unsafe HTML tags */ if ( ! current_user_can( 'unfi...