Uncategorized

Sidebars

April 2019

Call register_sidebar() for each sidebar you want to create. # Define the ‘main-sidebar’. add_action( ‘widgets_init’, ‘my_register_sidebars’ ); function my_register_sidebars(){ register_sidebar( array( ‘id’ => ‘main-sidebar’, ‘name’ => __( ‘Main Sidebar’ ), ‘description’ => __( ‘Widgets in this area will be shown on all posts and pages.’ ), ‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’, ‘after_widget’ => ‘</aside>’,

Custom Taxonomies in WordPress

November 2015

Define a Custom Taxonomy add_action( ‘init’, ‘ww_create_taxonomies’ ); function ww_create_taxonomies() { // Add new taxonomy, NOT hierarchical (like tags) register_taxonomy( ‘ww_languages’, // Unique ID for the “Languages” taxonomy. (always use a prefix) ‘ww_products’, // The post-type(s) this taxonomy can be applied-to . array( ‘hierarchical’ => false, ‘labels’ => array( ‘name’ => _x( ‘Languages’, ‘taxonomy general