the category city made as a subdomain
Try a Multi-Site install? Or this may be outdated but you could try the wordpress-subdomains plugin
Try a Multi-Site install? Or this may be outdated but you could try the wordpress-subdomains plugin
I’d use a bunch of widget areas to build up a home page like that. Register some extra sidebars (in this case they don’t actually have to be ‘sidebars’, they can be any size/shape) and then create a widget or widgets that can list posts from any category or list sticky posts etc… Registering Sidebars … Read more
global $wpdb; // In case it’s in a function… $parent = 0; // Change to dig deeper in tree $wpdb->query( <<<SQL SELECT t1.`term_id`, /* The ID */ t1.`name`, /* The name */ t1.`slug`, /* The slug */ t2.`parent`, /* The parent ID */ t2.`count` /* The item Count */ FROM {$wpdb->terms} AS t1, {$wpdb->term_taxonomy} AS … Read more
use a conditional statement, for example: $sub_cats = get_categories(‘parent=”.get_query_var(“cat’)); if( $sub_cats ) : //show list of child categories, for instance with wp_list_categories() echo ‘<ul>; wp_list_categories(‘title_li=&child_of=”.get_query_var(“cat’)); echo ‘</ul>’; //or possibly using $sub_cats and a foreach loop// 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>’; else: //the ‘normal’ LOOP of category.php// … Read more
Check if each category has a parent: foreach( ( get_the_category() ) as $category ) { if( $category->category_parent != 0 ): echo $category->cat_name . ‘ is a child category ‘; else: echo $category->cat_name . ‘ is a parent category ‘; endif; }
Well, I should have used the tax_query parameter. Something like the following: $the_query = new WP_Query( array(‘post_type’=>’ad_listing’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘ad_cat’, ‘field’ => ‘slug’, ‘terms’ => ‘7star’ ) ) ) );
Here are two plugins which might be useful for you: http://wordpress.org/extend/plugins/taxonomy-images/ http://wordpress.org/extend/plugins/category-images-ii/
Although it looks like by default it has the categories as a dropdown select, it looks like this plugin could be slightly modified to fit your needs: Taxonomy Picker Taxonomy Picker is a widget which you can include in your sidebar to help visitors build complex queries using categories and your custom taxonomies by chosing … Read more
It’s not really a category issue unless you want different areas to only show different actual categories. What I’ve normally done in this case is either use custom fields or set up a custom ‘presentation’ taxonomy so on a post I can check a box to say “this post is a ‘Main Highlight’” or “this … Read more
You should take a closer look at the [http://codex.wordpress.org/Template_Hierarchy Template Hierarchy]. From what I understood in your code is that you’re trying to list posts in the category where ID = 5. You can easily map that to the category-slug.php or category-id.php template files, so you won’t have to do any extra get_posts. The problem … Read more