Add the title of a widget as an ID – for anchor links

Yes you can add an around the title of the widget, you do this in the register_sidebar code which you would put in your functions.php add_action( ‘widgets_init’, ‘theme_register_sidebars’ ); function theme_register_sidebars() { register_sidebar( array( ‘id’ => ‘mysidebar-sidebar’, ‘name’ => __( ‘My Sidebar’, ‘themename’ ), ‘description’ => __( ‘Widgets for my sidebar’, ‘themename’ ), ‘before_widget’ => … Read more

Custom taxonomy archive templates not found

The page not found error doesn’t mean that the template file is not found/used. Note that a URL returns a 404 status header (not found), then 404.php is used (or index.php if 404.php doesn’t exist). I think your real problem is that you have not flushed the rewrite rules after the taxonomy has been registered. … Read more

Exclude sub sub categories from displaying in the archive page

/* exclude sons */ $_categories = get_categories(array( ‘child_of’ => 16)); $exclude=””; foreach($_categories as $category){ $_exclude .= ‘-‘.$category->term_id.’,’; } $_exclude = substr($_exclude,0,-1); $_cats = $cat.’,’.$_exclude; query_posts(array( ‘cat’ => $_cats )); while ( have_posts() ) : the_post(); …… endwhile;

How do you build a database-centric site in WP?

It’s not complicated to connect to custom tables in WP context and query them, using native wpdb class. However “not complicated” is about all there it. WP API functions are primarily aimed at querying its own data structures. While wpdb does have some helpers, they are simplistic and not meant for more elaborate custom queries. … Read more