jQuery does not work

Scripts and stylesheets should always be loaded in the head or in the footer via the wp_enqueue_scripts action hook. wp_enqueue_scripts is the proper hook to use when enqueuing items that are meant to appear on the front end The init hook executes before wp_head which is to early for script to load in the header. … Read more

Categorise Custom Post Types

Thanks guys, I found a solution: It’s as easy as adding the post_type_category element to the arguments object within register_post_type(): $args = array( ‘label’ => ‘sausages’, ‘description’ => ‘Sausages’, ‘labels’ => $labels, ‘post_type_category’ => ‘food’, ‘supports’ => array( ‘title’, ‘category’ ), ‘hierarchical’ => false, /* and so on */ ); register_post_type( ‘sausage’, $args ); And … Read more

How to customize category_description()?

I’ve been looking for a filter for category_description() and I have not found any. You could use wp_trim_words() with category_description() to get the desired result. For example: $cat_ID = 4; // wp_trim_words( $text, $num_words = 55, $more = null ); echo wp_trim_words( category_description( $cat_ID ), 55, ‘<a href=”‘ . get_category_link( $cat_ID ) . ‘”>’ . … Read more