How to add Categories to the top menu of the website?
You should be able to add categories with Appearance -> Menus. They are listed in the block below ‘pages’:
You should be able to add categories with Appearance -> Menus. They are listed in the block below ‘pages’:
I’ve checked this code localy, here is the working snippet: <?php $cat_args = array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ); $fcategories = get_categories($cat_args); foreach($fcategories as $fcategory) { echo ‘<dl>’; echo ‘<dt> <a href=”‘ . get_category_link( $fcategory->term_id ) . ‘” title=”‘ . sprintf( __( “View all posts in %s” ), $fcategory->name ) . ‘” ‘ … Read more
You can do this one of three ways: The first been you would need to make the menu static within the theme itself so you have full control over all the anchor links and classes In the menu manager you could assign a custom class to the anchor link and then bind jQuery events to … Read more
This is absolutely possible. By default, the category archive page will be at domain.com/category/the_category. The file that is typically used for this rendering is category.php, which is located in your theme directory. To remove the /category/ part, so that your category archives are at domain.com/the_category, you can use the SEO Ultimate plugin. After installing the … Read more
you can do that in multiple ways .. For example you can do a conditional in the PHP itself with a wp built in function : if ( in_category( ‘my-category’ ) { //Do something } or for example, if the script is a javascript you could load the script in a conditional way , so … Read more
This should do what you’re looking for. It’s untested, I just whipped it up really quick right now, but the concept is there. function my_get_highest_parent( $id ) { $cat = get_category( $id ); $parent = $cat->parent; if( $parent == 0 ) return $id; else my_get_highest_parent( $parent ); }
Update 3/5: When I originally answered this question I didn’t realize that your code was almost an exact copy of the wp_get_archives function. There is nothing in your code or the original wp_get_archives code that supports categories. The function was written to get date archives and your defaults are missing the type, limit, before and … Read more
Just use add_image_size() to set a new size for those cat images: add_image_size( ‘mosaic’, $your_width, $your_height, true );. The rest depends on your category image (this isn’t default, but done by some plugin or something else).
There isn’t an RSS of the names of the categories specifically otherwise I would have used the XML from the RSS feed with XSLT to display the category list that way. There is a handy function named add_feed(). You can create any feed or other output with it. Should be useful in your case. And … Read more
I found the solution… My functions page now looks like: <?php class dropdown extends Walker_CategoryDropdown { function start_el(&$output, $category, $depth, $args) { $pad = str_repeat(‘ ’, $depth * 3); $cat_name = apply_filters( ‘list_cats’, $category->name, $category ); $output .= “\t<option class=\”level-$depth\” value=\””.$category->slug.”\””; $output .= ‘>’; $output .= $pad.$cat_name; if ( $args[‘show_count’] ) $output .= ‘ (‘. $category->count .’)’; … Read more