WordPress.org

Forums

Bouquet
eliminating extra HTTP requests with child theme functions.php (4 posts)

  1. CKatzman
    Member
    Posted 1 year ago #

    I find that when I use Bouquet on a slow WIFI connection, that the theme loads very slowly. Unfortunately, other themes I considered had even more HTTP requests, so I'm sticking with Bouquet.

    I realized I could easily do without the fancy header font and its HTTP request, and I could make a similar background image using CSS that wouldn't require an HTTP request. I'd also like to combine multiple CSS files into one.

    However, changing the CSS won't get rid of the HTTP requests to all these files. I'll need to use a functions.php in my child theme in order to do that. I understand that WordPress loads the child theme's functions.php before the parent's, and that if there is no action hook in the parent theme, you need to use a remove action in the child theme.

    I know very little about php, but I'm aware that one false move in functions.php, even an extra space, can bring on a white screen and leave the site nonfunctional. I'd appreciate some help with this.

  2. Hi there, if you're new to PHP I might actually steer you away from making these types of modifications to functions.php, since what you're trying to do is pretty complex.

    Maybe there is another way to achieve your goal, and I'd be glad to help if I can, so let's start with some questions.

    Is your site is online somewhere so I can take a look?

    I just loaded up an unmodified copy of Bouquet on my test site and used the Web Developer's Toolbar to see the size:

    https://cloudup.com/c6LEvG8DqbR

    It's under 500K, which is quite small. Are you aiming for something below that?

    Specifically what types of Wifi connections are you concerned about? If it's mobile connections, you could consider a mobile plugin that loads a stripped-down version of the site.

  3. CKatzman
    Member
    Posted 1 year ago #

    My site is doulajerusalem.chanakatzman.com/en, but it's still under construction, so not all the pages have been uploaded. The underlined words that aren't yet colored maroon are not yet been activated as links.

    I'm trying to make this available to potential clients who may use public wifi. Most will probably not be using mobile connections. I want to avoid plugins whenever possible, since they tend to get outdated and involve extra HTTP requests that actually slow sites down.

  4. Your entire homepage is only 205 KB, so I'd say you've done a fantastic job here.

    A few other things you might want to look at:

    - this image might be smaller if you compressed it as a JPG instead of a PNG: http://doulajerusalem.chanakatzman.com/en/wp-content/themes/bouquet/colors/pink-dogwood/pink-dogwood-header.png
    - you might want to look at minifying and/or concatentating your scripts and stylesheets. Minifying removes whitespace and otherwise compresses your CSS and JavaScript files as much as possible. More info here. Concatenation connects scripts and stylesheets together.
    - you could look at using a caching plugin
    - you could look at using an image-compression plugin

    Plugins on their own don't necessarily slow down a site if their actual purpose is to speed it up, but I understand your concerns.

    Hope these tips are helpful.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic