Joe Casabona is a web developer, teacher, and author of the book Building WordPress Themes from Scratch. He hails from Middletown, NY and has been making websites since 2002. He was introduced to WordPress in 2004 and has been working with it ever since.

  1. 1

    I’ve just learnt a couple of new WordPress tricks, so thanks for the tutorial! :-)

    +6
  2. 2

    Wow lots of useful customization tips.

    I tend to search for tips like these as and when the need arises. Can you (or anyone) recommend a good place to go for a curated library of tips like these?

    +1
  3. 6

    Thanks for the great post!

    I implemented “Customize WordPress’ Log-In Screen” and found that if you’re using a child theme you should replace;

    background: url(‘”.get_bloginfo(‘template_url’).”/images/custom-logo.png’) no-repeat scroll center top transparent;

    with

    background: url(‘”.get_bloginfo(‘stylesheet_directory’).”/images/custom-logo.png’) no-repeat scroll center top transparent;
    background-size: ?px ?px;

    Be sure to use background-size to override the default style.

    You can also use the following to link to your home page instead of a hard-coded url.

    add_filter(‘login_headerurl’,
    create_function(false,”return ‘/’;”));
    add_action(“login_head”, “custom_login_logo”);

    The above modifications should be attributed to Evan Mullins.

    +3
    • 7

      Joseph Casabona

      June 20th, 2012 9:06 am

      That’s a great point- because of the WP architecture, get_bloginfo(‘template_url’) will always grab the parent theme’s path. If you’re dealing with a child theme, get_bloginfo(‘stylesheet_directory’) will grab the proper path. My recommendation is to do something like define('TEMPPATH', get_bloginfo(‘stylesheet_directory’));, which defines a constant that you can use throughout your theme. If you need to change it, you can easily do it in one spot instead of several.

      Thanks Tim/Evan!

      0
  4. 8

    I have learnt something new, I have only just started using WordPress and this article has increased my knowledge, thank you for sharing this information.

    0
  5. 9

    Excellent tips!! Thank you so much!!

    -3
  6. 10

    Hi, Nice article, but unfortunately after days & hours of searching & doing, I couldnt device a method of creating a second contact form for a Product for example, with some extra(custom fields) to work properly using only hooks and not rambling away at the core. I wish it was as easy to customize WP with hook as most people say. The only option I was left with was to by a plugin like gravity Forms which was not what I wanted (trying/dying to learn WP the right way). I wish one of you guys/gals could put up a tut which goes through this process. None the less this is a cool post. Thnx again.

    +4
  7. 11

    First off, thanks for sharing your tips. However, I do have a conflict with one area: Change The Default Source Of jQuery.

    Although this does work and is stated in the WP Codex, it should be noted that deregistering jQuery is not recommended. I realized that you are merely changing the source of jQuery (keeping the jQuery version and WP version in line), but other users may interpret this as a way to add a completely different version. Perhaps one that works with some jQuery plugin they are using.

    Although there are several reasons this is a problem, the main reason is that plugin and theme developers often rely on jQuery and have to use the version of jQuery built into WordPress. If the user is changing the version, this will often cause conflicts with these themes and plugins.

    Since you did only mention changing the source, I would like to add that this too causes a problem when updating WordPress. Now the administrator has two separate items to update in order to avoid conflicts (which we all know can be a pain).

    Other than that, there are some great tips here. Especially creating custom templates for taxonomies. I am surprised how often people fail to use custom templates for taxonomies (using conditional statements instead).

    Another great feature (not mentioned here) is the use of post formats. Post formats are a great way to alter your content based type of post you are writing.

    Cheers to a good post.

    +4
  8. 15

    Jonathan Worent

    June 20th, 2012 10:04 am

    I hate that I don’t hate WordPress anymore. ;)

    -3
  9. 16

    your article makes no sense to any reader that doesn’t know the context of the functions you are describing – the go into post content? a template page? where?

    -2
  10. 17

    Unfortunately I agree with ‘rickdog’. The article breezes over filters, hooks, registering menus and enquing scripts, in such a way that I would expect those that can follow it already know where to look for the code snippets and wp hacks they need.

    I also feel like this article is a bit of a random collection of WP code snippets. Don’t get me wrong, random WP code snippets are great! And Joe has covered some good ones. But from Smashing Magazine I expect there to be a little more purpose to the article. Sorry Smashing Magazine.

    +5
    • 18

      I agree with rickdog and Mike. Why do so many posts neglect explaining exactly where to place code? It’s useless otherwise and reading posts that fail on this point (they’re rampant!) turns what begins as a promising chance to advance into a frustrating experience.

      My best teachers have been textbooks, but with the proliferation of blogs and self-proclaimed experts, you’d think otherwise. Maybe even that textbooks might face extinction in the near term. Countless websites are shouting at the top of their voice that they have the best of what you want only to deliver a small fraction of what they claim.

      What happened to the wisdom of under promise and over deliver? The Digital Age practices the opposite. It’s no wonder Google is demanding content. No retail business could survive, as some websites must, simply by getting people into the store.

      Enough on that.

      What needs to happen for me in this post (and others):
      (1) Identify by name the file or files into which the code is to be placed.
      (2) Describe where the file is, how to find it and how to access it (I access my WP files on the server and also thru the dashboard).
      (3) Explain how to test that it works after the code is modified.
      (4) Finally, describe any caveats that experimenters ought to know to avoid regret.

      I appreciate post publishers who take the time to publish clear, valuable content that demonstrates a desire for readers to comprehend and learn.

      0
  11. 19

    Hi Joseph

    Thanks for a great post!

    Loved the tips and tricks you shared, i think custom post types is another great addition, and there is plugins to help with the coding.

    Thanks
    Joe

    0
  12. 20

    Rafał Gicgier

    June 20th, 2012 9:06 pm

    Hey,

    Nice post, though I have couple of comments – I basically agree with rickdog a bit – for noobs (and I’m not using that word in the negative context) this tutorial won’t be helpful.

    As for the register sidebar – it’s not perfect,

    ‘before_widget’ => ”,

    should be changed to:

    ‘before_widget’ => ”,

    This is really important, since certain widgets come with a different CSS, not having it included might ultimately degenerate the markup.

    Also for the Splash Page – this approach will ONLY work if front-page.php file has not yet been defined. Page Template has lower priority than front-page.php

    Please refer to http://codex.wordpress.org/Template_Hierarchy

    Apart from the above the article outlines everything nicely :)

    0
  13. 21

    Rafał Gicgier

    June 20th, 2012 9:09 pm

    It appears that my comment was sanitized :p

    So for the register sidebar check the before_widget declaration at http://codex.wordpress.org/Function_Reference/register_sidebar (notice the % $ added)

    0
  14. 22

    keith Feldwick-Davis

    June 20th, 2012 9:21 pm

    Some very handy tips here and a well written and easy to follow article.

    0
  15. 23

    Elliott Richmond

    June 20th, 2012 11:19 pm

    Great resource :-)

    +1
  16. 24

    Great tutorial ! But regarding jQuery I prefer this URL :
    http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
    Because you do not have to worry about update.

    +1
    • 25

      Thank you for this! :)

      +1
    • 26

      You should never do that. In production, your jQuery file references should always be specific. I wrote about this a little while ago:

      http://www.impressivewebs.com/linking-to-jquery/

      As an example (mentioned in my article), $.browser is deprecated in 1.7.2 (the current release), so it may not work when that URL updates to jQuery 1.8.

      It’s bad practice to use those types of URLs that aren’t specific, so avoid them except maybe when you’re testing and experimenting locally.

      +1
      • 27

        The URL links to the latest version of jQuery on Google’s servers. I don’t deny what you’re saying but I don’t think it will change anything until jQuery 2.0. However I care about good practise so thanks for the update ! :)

        0
  17. 28

    Ameya Pimpalgaonkar

    June 23rd, 2012 10:41 am

    This is fantastic information. I especially loved author comment highlighting and I just implemented that into my blog re-design. Thanks for all the information.

    Ameya

    0
  18. 29

    Anil Kumar Panigrahi

    June 27th, 2012 11:11 pm

    Thanks for nice information Joseph. I will soon implement few changes in my blog http://www.anil2u.info which you mentioned author comment highlight from user comment.

    0
  19. 30

    Every time I visit Smashing, I find something useful.
    Thanks once again. :)

    0
  20. 31

    I’ve used ‘Highlight The Author’s Comments’ and custom ‘WordPress Login Screen’ on my website. you can see it @: tarikz.co.uk. Thanks for tips!

    0
  21. 32

    Mithilesh kumar

    July 17th, 2012 2:08 am

    It’s very helpful for us

    0
  22. 33

    Thank You Joseph, It’s very helpful….

    0
  23. 34

    Thanks for the tips about the Customize WordPress’ Log-In Screen. I will try it on wptheme.fr !

    0
  24. 35

    Adored the particular guidelines an individual contributed, i do believe custom made submit sorts is an additional fantastic inclusion, then there is extensions to aid with all the code.

    http://phlebotomytraining411.com/

    0
  25. 36

    You can try out my new plugin for customizing WP Scroll Bar.
    http://codecanyon.net/item/wp-ninja-scroll-bar-customizer/4691714

    0
  1. 1

    I’ve just learnt a couple of new WordPress tricks, so thanks for the tutorial! :-)

    +6
  2. 2

    @giles farrow: here are a lot of tips:
    http://wp-snippets.com/

    have fun :D

    +5
  3. 3

    Unfortunately I agree with ‘rickdog’. The article breezes over filters, hooks, registering menus and enquing scripts, in such a way that I would expect those that can follow it already know where to look for the code snippets and wp hacks they need.

    I also feel like this article is a bit of a random collection of WP code snippets. Don’t get me wrong, random WP code snippets are great! And Joe has covered some good ones. But from Smashing Magazine I expect there to be a little more purpose to the article. Sorry Smashing Magazine.

    +5
  4. 4

    First off, thanks for sharing your tips. However, I do have a conflict with one area: Change The Default Source Of jQuery.

    Although this does work and is stated in the WP Codex, it should be noted that deregistering jQuery is not recommended. I realized that you are merely changing the source of jQuery (keeping the jQuery version and WP version in line), but other users may interpret this as a way to add a completely different version. Perhaps one that works with some jQuery plugin they are using.

    Although there are several reasons this is a problem, the main reason is that plugin and theme developers often rely on jQuery and have to use the version of jQuery built into WordPress. If the user is changing the version, this will often cause conflicts with these themes and plugins.

    Since you did only mention changing the source, I would like to add that this too causes a problem when updating WordPress. Now the administrator has two separate items to update in order to avoid conflicts (which we all know can be a pain).

    Other than that, there are some great tips here. Especially creating custom templates for taxonomies. I am surprised how often people fail to use custom templates for taxonomies (using conditional statements instead).

    Another great feature (not mentioned here) is the use of post formats. Post formats are a great way to alter your content based type of post you are writing.

    Cheers to a good post.

    +4
  5. 5

    Hi, Nice article, but unfortunately after days & hours of searching & doing, I couldnt device a method of creating a second contact form for a Product for example, with some extra(custom fields) to work properly using only hooks and not rambling away at the core. I wish it was as easy to customize WP with hook as most people say. The only option I was left with was to by a plugin like gravity Forms which was not what I wanted (trying/dying to learn WP the right way). I wish one of you guys/gals could put up a tut which goes through this process. None the less this is a cool post. Thnx again.

    +4
  6. 6

    Thanks for the great post!

    I implemented “Customize WordPress’ Log-In Screen” and found that if you’re using a child theme you should replace;

    background: url(‘”.get_bloginfo(‘template_url’).”/images/custom-logo.png’) no-repeat scroll center top transparent;

    with

    background: url(‘”.get_bloginfo(‘stylesheet_directory’).”/images/custom-logo.png’) no-repeat scroll center top transparent;
    background-size: ?px ?px;

    Be sure to use background-size to override the default style.

    You can also use the following to link to your home page instead of a hard-coded url.

    add_filter(‘login_headerurl’,
    create_function(false,”return ‘/’;”));
    add_action(“login_head”, “custom_login_logo”);

    The above modifications should be attributed to Evan Mullins.

    +3
  7. 7

    Agreed – the way mentioned in this article shouldn’t be done. There’s a few plugins that give you the CDN advantage without messing with “which” version of jQuery is loaded. http://wordpress.org/extend/plugins/use-google-libraries/ and http://wordpress.org/extend/plugins/wp-jquery-plus/ (mine) attempt to get around this issue. But as always, tread carefully.

    +2
  8. 8

    Wow lots of useful customization tips.

    I tend to search for tips like these as and when the need arises. Can you (or anyone) recommend a good place to go for a curated library of tips like these?

    +1
  9. 9

    You should never do that. In production, your jQuery file references should always be specific. I wrote about this a little while ago:

    http://www.impressivewebs.com/linking-to-jquery/

    As an example (mentioned in my article), $.browser is deprecated in 1.7.2 (the current release), so it may not work when that URL updates to jQuery 1.8.

    It’s bad practice to use those types of URLs that aren’t specific, so avoid them except maybe when you’re testing and experimenting locally.

    +1
  10. 10

    Elliott Richmond

    June 20th, 2012 11:19 pm

    Great resource :-)

    +1
  11. 11

    Great tutorial ! But regarding jQuery I prefer this URL :
    http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
    Because you do not have to worry about update.

    +1
  12. 12

    Thank you for this! :)

    +1

Leave a Comment

Yay! You've decided to leave a comment. That's fantastic! Please keep in mind that comments are moderated and rel="nofollow" is in use. So, please do not use a spammy keyword or a domain as your name, or it will be deleted. Let's have a personal and meaningful conversation instead. Thanks for dropping by!

↑ Back to top