What questions do you ask when asked to give an estimate on theme development?

I think some of your questions are too wide. You still cannot break down each answer in hours. Some of the questions I ask: Are there widgets? Which? Which theme options are needed? Details? Colors, text fields, image uploads etc. Custom post types and taxonomies? Very, very detailed. How are the comments displayed? This one … Read more

Display Menu Name using wp_nav_menu

If you know the menu’s slug, then things are easier, otherwise you can use this function to get the menu at a specified location. <?php function wpse45700_get_menu_by_location( $location ) { if( empty($location) ) return false; $locations = get_nav_menu_locations(); if( ! isset( $locations[$location] ) ) return false; $menu_obj = get_term( $locations[$location], ‘nav_menu’ ); return $menu_obj; } … Read more

theme path in javascript file

What you’re looking for is wp_localize_script function. You use it like this when enqueing script wp_register_script( ‘my-script’, ‘myscript_url’ ); wp_enqueue_script( ‘my-script’ ); $translation_array = array( ‘templateUrl’ => get_stylesheet_directory_uri() ); //after wp_enqueue_script wp_localize_script( ‘my-script’, ‘object_name’, $translation_array ); In your style.js, there is going to be: var templateUrl = object_name.templateUrl; …

CSS not updating in browser when I change it

Add a random version number at the end of the css file you are attaching. If you are using ‘wp_enqueue_style‘ or wp_register_style functions, pass a random (version) number rand(111,9999) to 4th parameter. If you are attaching css as an html tag, you should add “?ver=<?php echo rand(111,999)?>” at the end of the file name. Examples … Read more

How important is it to enqueue a theme’s stylesheet?

It’s important to enqueue the stylesheet because it will allow child themes the flexibility of dequeueing it as well as allowing it to be listed for dependencies and a multitude of other things. It just generally allows greater flexibility, both for you and for any other developers who interact with your code. It’s also important … Read more

How to add custom css file in theme?

I usually add this piece of code if I want to add another css file <link rel=”stylesheet” href=”https://wordpress.stackexchange.com/questions/58351/<?php bloginfo(“template_url’); ?>/css/my_custom_css.css” type=”text/css” media=”screen” /> I believe the theme makers want to retain as much as possible of the theme’s layout design. So a custom css file doesn’t hurt much. I think it’s more of a support … Read more