WordPress Child Themes

It is somewhat counter-intuitive but WordPress loads child’s theme code before parent’s theme. So wrapping anything in function_exists() in child theme does nothing, it’s parent theme that needs to have that. Better option is to unhook parent’s theme function (unless it’s run right at load, which it should not do) and hook your own.

If has $title in widgets

Should be possible like this: <?php /** @see WP_Widget::widget */ function widget( $args, $instance ) { extract( $args ); $title = apply_filters( ‘widget_title’, $instance[‘title’] ); # >>>> NEW if ( ! isset( $title ) OR empty( $title ) ); return; # <<<< NEW echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; … Read more

Woo Framework: woo_cat_featured not populating

So I fixed it by changing array( ‘taxonomy’ => ‘category’, ‘terms’ => array( $woo_options[ ‘woo_cat_featured’ ] ), ‘field’ => ‘ID’, ‘operator’ => ‘IN’ ), to array( ‘taxonomy’ => ‘category’, ‘terms’ => array( $woo_options[ ‘woo_cat_featured’ ] ), ‘field’ => ‘slug’, ‘operator’ => ‘IN’ ), Specifically: ‘field’ => ‘ID’, to ‘field’ => ‘slug’, . I’m not sure … Read more

Custom field values to taxonomy terms

Don’t have a time to test it now but something like this should work: // Change or add your own arguments as needed $args = array( ‘post_type’ => ‘post’, ‘numberposts’ => -1, ‘offset’ => 0 ); $my_posts = get_posts( $args ); if ( $my_posts ) { foreach ( $my_posts as $my_post ) { $meta = … Read more

PHP code to use on next & previouspage links

adjust the ‘nextpagelink’ and ‘previouspagelink’ arguments for wp_link_pages() to have a css class you can style $args = array( ‘nextpagelink’ => ‘<span class=”next”>’ . __(‘Next page’) . ‘</span>’, ‘previouspagelink’ => ‘<span class=”prev”>’ . __(‘Previous page’) . ‘</span>’ ); wp_link_pages($args); then in your css you can style those spans to use your arrows as background images.

running arbitrary php files

WordPress offers a dedicated API for your need: the Plugin API. So (let) write a plugin, which is really easy. Then you can use the extra code probably without conflicts.