Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • edit:** the option above to only show the cforms header on specific pages is also part of the options in global settings. I think I re invented the wheel.

    I had the same problem with removing the cforms code from the header but don’t like to mess in the plugin code since you should redo your actions after every update and cforms updates a lot.

    I think the following line is much easier. You could write a plugin for it or include it in functions.php which has my preference.

    function remove_cforms_header() {
    
    		if (!is_page('13')){
    
    	   remove_action('wp_head', 'cforms_style');}
        }
    
        add_action('wp_head', 'remove_cforms_header', 1);

    Basically it adds an action to wp_head in which the style sheet for cforms is called. My custom function looks into the wp_head and only takes action if the page is not my contact page, ie page 13.

    On all other posts and pages the function remove_action is used to remove the cforms action.

    I had some trouble implementing this and note that the priority variable ‘1’ is absolutely required since it gives this action a higher priority than the action by cforms.

    Hope it helps

Viewing 2 replies - 1 through 2 (of 2 total)