Move custom code out of theme’s functions.php file

In previous questions you mentioned that you created a child theme and installed the multiple themes plugin so that you could put code on a specific page on your site. So you’ve been using child themes in a way that they weren’t intended to be used. Instead, think of a child theme as a transparency, … Read more

Force wordpress to request for FTP Info on theme/plugin install/update

I just tried this on a local install that previously used the ‘direct’ FS_METHOD. In wp-config.php, set the following constants: define(‘FS_METHOD’, ‘ftpext’); Not sure if this actually affects things, but I also set these to try to force the input fields to be empty when the form is presented: define(‘FTP_USER’, false); define(‘FTP_PASS’, false); Source: http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants

How can I customize the search results in Bones theme?

Filter ‘the_excerpt’ on the search page only: add_filter( ‘the_excerpt’, ‘wpse_99415_search_excerpt’ ); function wpse_99415_search_excerpt( $excerpt ) { if ( ! is_search() ) return $excerpt; global $post; // create a custom excerpt return $custom_excerpt; }

Manipulate list of themes in wp-admin

Probably not without editing core files. I haven’t found any hook you could use. If you look in the file wp-admin/themes.php and follow the program flow until the list of themes will be displayed, you can find the class WP_Themes_List_Table in wp-admin/includes/class-wp-themes-list-table.php. This class generates the HTML list. Following the prepare_items() method, WordPress get the … Read more

Register theme customizer settings when theme activates [duplicate]

You need only use the default value on the wp_customize and that is all $wp_customize->add_setting(‘mytextoption’, array( ‘default’ => ‘defaultvalue’, ‘capability’ => ‘edit_theme_options’, ‘type’ => ‘option’, replace defaultvalue for the value you want, and when the user activate the theme this line will register the default value on the DB only when not exist on the … Read more

Show attribute description when filtering by that attribute

You need to check when filter is enabled and take selected attribute taxonomy, ‘pa_brand’ in this case: add_action( ‘woocommerce_before_shop_loop’, ‘desc_before’, 75 ); function desc_before() { if (is_filtered()) { $brands = WC_Query::get_layered_nav_chosen_attributes() [‘pa_brand’]; if ( isset($brands) ) { foreach ($brands[‘terms’] as $term ) { $term_obj = get_term_by(‘slug’, $term, ‘pa_brand’); echo ‘<div class=”ka-attr-description”>’. ‘<h4>’ . $term_obj ->name … Read more

Style.css redirects to 404 Page not found

Your directory permissions for your Theme directory are incorrect. wp-content: 0755 wp-content/themes: 0755 wp-content/themes/kenchristy: 0700 Per the Codex, folder permissions should be set to 755: In such an suexec configuration, the correct permissions scheme is simple to understand. All files should be owned by the actual user’s account, not the user account used for the … Read more