ashley
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Serene] Alter category.php to show sub categories?Here’s category.php:
<?php /** * @package Serene * @since Serene 1.0 */ get_header(); if ( have_posts() ) : while ( have_posts() ) : the_post(); get_template_part( 'content', get_post_format() ); endwhile; get_template_part( 'includes/navigation', 'index' ); else: //get_template_part( 'includes/no-results', 'index' ); $cat=get_query_var('cat'); $args = array( 'orderby' => 'name', 'parent' => $cat, 'order' => 'ASC' ); $categories = get_categories($args); foreach($categories as $category) { echo '<p>Category: <a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </p> '; echo '<p> Description:'. $category->description . '</p>'; } endif; get_footer(); ?>Forum: Themes and Templates
In reply to: [Serene] Alter category.php to show sub categories?Still doesn’t seem to be working; I’ve edited category.php as suggested, but viewing the category still displays a list of posts in child categories, rather than the child categories themselves. Perhaps I’m using the functions incorrectly? I’m trying to:
If the category is a top level category, display a list of its parents.
If the category is a child category, display its postsForum: Themes and Templates
In reply to: [Serene] Alter category.php to show sub categories?Thanks.
Forum: Themes and Templates
In reply to: [Serene] Alter category.php to show sub categories?Thanks – I thought it may be those functions. Get_categories requires a category ID; from where do I get that? Surely it’s not via $_GET.
Forum: Fixing WordPress
In reply to: Show category>subcategory>postsThanks for your reply. I’m not looking to do a dropdown menu; what I’m looking for is that each category page shows a list of categories, unless it is the lowest level category; in which case, it shows the posts.
If necessary; I’ll have to modify my theme and do this in PHP. Just was kindaa hoping there would be an easier way, given that WP is supposed to be point n’ click… or am I perhaps just getting lazy?Forum: Fixing WordPress
In reply to: Show category>subcategory>postsOK, Progress. Using a widget called ‘NS Category Widget’, I’ve managed to get only the top level categories to display on my pages, irespective of whether they contain any posts.
So all that’s left is to figure out how to:
When a user clicks a category, present the user with a list of categories on the resulting pageAny ideas?
Thanks for that – Am experimenting with contact form 7 and it looks like it will better meet my needs, so have decided to use that. Thanks for the recommendation 🙂