Support » Themes and Templates » Suffusion stop loading wp-admin.php

  • IS there a way to stop the theme Suffusion from loading all of its javascript and css on every page of the admin section.

    Could it be limited to the pages that actually require the scripts and css obviously i know some of the http request would be needed on most pages but do we really need it all the time even if im just browsing to add new plugins.

    The theme is extremely good but could do with a small modification to cut down the http requests in the admin section.


    Please dont take this as a knock on how much i like the theme just for me i am trying to clean up the admin.

    Just wish more plugin developers made things easier on admin overhead. (not that im not gratefull).

    If anyone is prepared to help me clean this up i will give you a nice link or review of your site.

Viewing 8 replies - 1 through 8 (of 8 total)
  • I will look into this and try to fix it in the next version. Thanks for the input.

    Thank you sayontan your a star.

    can anyone help fix it for me

    It will need a few significant changes on your side. If you don’t mind, waiting for next version might be a good idea. I have already fixed it my end and am in the process of bundling it with some other changes. I should be done a few days at the most.

    yeah thanks sayontan the problem im faced with is i cant upgrade the site as i have made changes to alot of things. My knowledge of php is limited so i have hard coded the files.

    I know this is alot to ask but do you have a detailed change log of what code you add and what you removed so people that cant do an auto upgrade are able to manually change the required files.

    most of the chages i have made are specific such as combining css files and changing some php calls etc..

    Given that the theme offers capabilities to add both, custom CSS and custom PHP, I must say that you went down a path that was a general time-sink since the theme’s approaches would have been completely upgrade-proof.

    There is a change log which says what I have changed in terms of features, but it doesn’t say which file or which line was changed. For that you have to resort to using programs like WinMerge.

    I don’t, by a rule support older versions, so the instructions I am giving you here will not be valid for porting future releases.

    The way to tackle this is through some major changes, like using the admin_head-{$hook_suffix} variable hook instead of the admin_head hook. For this you have to do a bunch of things like moving the add_action calls around. A summary of the changes for 3.4.8 are as follows:
    1. In functions.php open the function suffusion_add_admin and change this line:

    add_theme_page($themename." Theme Options", "".$themename." Theme Options $update_available", 'edit_themes', basename(__FILE__), 'suffusion_admin');


    $suffusion_theme_options_page = add_theme_page('Suffusion Theme Options', "Suffusion Theme Options $update_available", 'edit_themes', basename(__FILE__)), 'suffusion_render_options');

    Immediately after this, add the following lines:

    add_action("admin_head-$suffusion_theme_options_page", 'suf_admin_header_style');
    	add_action("admin_print_scripts-$suffusion_theme_options_page", 'suffusion_admin_script_loader');

    Delete these lines from outside this function call:
    add_action('admin_head', 'suf_admin_header_style');
    add_action('admin_print_scripts', 'suffusion_admin_script_loader');

    Be very careful while you make these changes and be sure to have a backup of functions.php before you begin. Errors can render your dashboard inaccessible.

    Yes i agree its a slippery slope but had to be done as my sites download was nearing 1mb with 150 http calls taking a very longtime to download i have a sister site that is an exact copy of the main (just blocked from view) when i get chance i will try and figure the php to add it all in correct.

    As for css i had to edit it manually as when files are merged and minified the aperance goes out of whack.

    But thank you very much for your help i will give it a go now.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Suffusion stop loading wp-admin.php’ is closed to new replies.