Title: Less php, more html
Last modified: August 19, 2016

---

# Less php, more html

 *  [longwing1](https://wordpress.org/support/users/longwing1/)
 * (@longwing1)
 * [18 years ago](https://wordpress.org/support/topic/less-php-more-html/)
 * I’ve pretty much got my theme fixed the way I want it now. There are a lot of
   static elements using php which seems a little unnecessary. My blog keeps asking
   the database what it’s name is but it never seems to learn. If I convert as much
   php code to html as I can for the static elements, can I expect much performance
   improvement.
 * Also I want to bring some of the get_XXX() code into the forms. Will this speed
   anything up? I’ve only got 3 forms that need to be maintained (main, pages, single_post)
   so that doesn’t seem like too big a deal.
 * Finally, will it speed anything up if I gut the stylesheet of any unused information?
 * Thanks!

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

 *  [Michael Fields](https://wordpress.org/support/users/mfields/)
 * (@mfields)
 * [18 years ago](https://wordpress.org/support/topic/less-php-more-html/#post-777482)
 * > My blog keeps asking the database what it’s name is but it never seems to learn.
 * Oh, but it does! Your blog name is stored in the $GLOBALS array
 * `<?php print $GLOBALS['wp_object_cache']->cache['options']['alloptions']['blogname'];?
   >`
 * When you access your blog’s name through one of the following methods:
 * `bloginfo('blogname');` or `get_option('blogname')` you are not querying the 
   database – you are using a cached query. Hard-coding your blog’s name will not
   really help you optimize your blog at all – it will merely cheat you out of some
   helpful functionality (changing your blog’s name through the WordPress Administration
   panels).
 * > If I convert as much php code to html as I can for the static elements, can
   > I expect much performance improvement.
 * There are a few functions that you can cut back to optimize performance. wp_list_pages
   can add **a lot** of queries to each page view as well as any function that makes
   repeated calls to the get_post() function.
 * > Finally, will it speed anything up if I gut the stylesheet of any unused information?
 * This will definitely help to speed up client/server request times. You can also
   compress your css files with a tool like: [http://floele.flyspray.org/csstidy/css_optimiser.php](http://floele.flyspray.org/csstidy/css_optimiser.php)
 *  Thread Starter [longwing1](https://wordpress.org/support/users/longwing1/)
 * (@longwing1)
 * [18 years ago](https://wordpress.org/support/topic/less-php-more-html/#post-777547)
 * mfields, Thanks for the help. It will take me a while to figure out what you’re
   saying about wp_list_pages, but I’ll work it over this weekend.

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

The topic ‘Less php, more html’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [longwing1](https://wordpress.org/support/users/longwing1/)
 * Last activity: [18 years ago](https://wordpress.org/support/topic/less-php-more-html/#post-777547)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
