Making custom woo themes

WooCommerce is an e-commerce plugin and although it offers a great deal of filter hooks, function calls and theme support it’s not technically a theme framework. Generally speaking WooCommerce will work with just about any theme right out of the box. But it does support customizing it’s own pages/layout by copying it’s files to the … Read more

Do I need to include a textdomain if my theme doesn’t support translation?

If your code, be it a theme or a plugin, does not support translation, then don’t use the translation functions. And if you don’t use these functions, you cannot use a text domain. 🙂 There is a very common error that looks like this: echo __( ‘Portfolio’ ); Portfolio is not part of WordPress’ core … Read more

Weirdness in jQuery supplied with WordPress

There is a difference with the version of jQuery supplied with WordPress as outline on the Codex page for wp_enqueue_script: Note: The jQuery library included with WordPress loads in “no conflict” mode. This is to prevent compatibility problems with other javascript libraries that WordPress can load. Change your script to reference the jQuery object with … Read more

How to add menù section to my WordPress template?

You need to edit functions.php andding the following line <?php register_nav_menu( ‘primary’, ‘Primary Menu’ ); ?> Then go in admin section Apearence-Menus and create one menu In the header replace <?php wp_list_pages(‘title_li=&depth=1’); ?> for example (the primary menu) with: <?php wp_nav_menu( array( ‘theme_location’ => ‘primary’)); ?> more details for nav_menu here

Use different single.php file based on condition

In a previous edit you used: if (in_category(’21’)) { include (TEMPLATEPATH . ‘/single-21.php’); } else { include (TEMPLATEPATH . ‘/single-29.php’); } This is part of your solution, but before I continue, some important notes: Don’t use include like that, instead get_template_part(‘single-21’); works better Indent correctly This clashes with how IDs work in the template heirarchy. … Read more

Theme not calling Jquery properly

If you register a script with wp_register_script() it is not neccessary to pass all the options in wp_enqueue_script() again. You can register the script in a central place and use the enqueueing it in diffenrent files. functions.php wp_register_script( ‘theme_script’, ‘path/to/script.js’, array( [dependencies] ), ‘1.0’, true ); […] if ( $condition ) require_once ‘file1.php’; else require_once … Read more