list all child categories that apply to current post even if those cats are empty?

get_the_category() get_categories() get_category_link() <?php echo ‘<ul>’; foreach(get_the_category() as $cat) { echo ‘<li><a href=”‘.get_category_link($cat->term_id).'”>’.$cat->name.'</a>’; $sub_cats = get_categories(‘parent=”.$cat->term_id.”&hide_empty=0’); if($sub_cats) { echo ‘<ul>’; foreach($sub_cats as $sub_cat) { echo ‘<li><a href=”‘.get_category_link($sub_cat->term_id).'”>’.$sub_cat->name.'</a></li>’; } echo ‘</ul>’; echo ‘</li>’; } } echo ‘</ul>’; ?> edit: for a list of sub categories in a category archive, try this code: <?php $cat = get_query_var(‘cat’); … Read more

Creating an Events Feed with Sub Pages/Posts for Each Event

when you create a custom post type, and make it hierarchical, it will behave like pages. so you can have sub events the same way you have sub pages. look at register_post_type function arguments here : http://codex.wordpress.org/Function_Reference/register_post_type#Arguments then use wp_list_pages function to list subpages. see : http://codex.wordpress.org/Function_Reference/wp_list_pages#List_members_of_a_custom_post_type something like this (not tested) : <?php $args … Read more

Does “Custom Post Type” can have page hierarhy option?

You can set a post type to hierarchical when you register it with register_post_type. Simply set the ‘hierarchical’ argument to true. $args = array( ‘public’ => true, ‘publicly_queryable’ => true, ‘has_archive’ => true, ‘rewrite’ => true, … ‘hierarchical’ => true, … ‘supports’ => array( ‘title’, ‘editor’, ‘author’, ‘thumbnail’, ‘excerpt’, ‘comments’,’page-attributes’ ) ); register_post_type(‘my-cpt’,$args);

Check is category parent with ids from the childs – get_term_children

Sry, here is my answer: Here is first the output for listing the category in checkbox: Walker for the Category Output class Adv_Multicheck_Walker_Category extends Walker { var $tree_type=”category”; var $db_fields = array (‘parent’ => ‘parent’, ‘id’ => ‘term_id’); function start_lvl($output, $depth, $args) { if ( ‘list’ != $args[‘style’] ) return $output; $indent = str_repeat(“\t”, $depth); … Read more

Use an archive as the parent of a page?

Once wordpress reads the “Events” part of the URL it knows that what follows are posts or subcategories of the events category, and a page is neither, and that is the reason you don’t even have an option of doing what you want. Do it as a post instead of a page. Then edit you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)