Where to locate the proper file?

Hello again

Just want some help in locating the exact file related to taxonomy.....was following one article and found that as per WordPress’s template hierarchy...when a taxonomy page is encountered by the user, the sequence in which WordPress checks what WordPress theme page template to use is this: taxonomy-[taxonomy_term].php > taxonomy-taxonomy.php > taxonomy.php > archive.php > index.php.

What this means is that, going left to right, WordPress will use the first file it encounters that matches the naming convention....I have edited the mp_taxonomy.php and gave it a new name...taxonomy-[new taxonomy slug].php but it still fetches only the product description part and not products in grid display format with "Blog Archives" as title......WordPress shows this file (archive.php) only when the first three files are non-existent and displays the archive.php page

I need to display products as a gridded list page when one clicks on my newly created taxonomy.php.
But for some strange reason WP is not reacting as it should....Since my new file is higher in the page template hierarchy (i.e., it’s taxonomy-[taxonomy-term].php), WordPress should load this file instead of archive.php.

I know I'm goofing up somewhere...but unable to pin-point it....can someone please help me? This is the code I'm using in taxonomy file
<?php
// custom template for taxomony
get_header();
?>
<?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); ?>
<div id="content">
<?php if ( class_exists( 'MarketPress' ) ) {
?>
<h1 class="post-title"><?php _e( __( 'Products with Medium: %s', 'framemarket' ), '<span>' . $term->name . '</span>' ); ?></h1>
<div id="mp-product-grid">
Description:<?php echo term_description( '', get_query_var( 'taxonomy' ) ); ?>
<?php query_posts(array( 'post_type'=>'product', 'product_mediums'=>$term->slug)); ?>
<?php framemarket_grid_mp_list_products();?>
<div class="clear"></div>
</div>
<?php
}
?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

And this in my product file

<?php // custom template for product single view
get_header();
?>
<div id="content">
<h1 class="post-title"><?php the_title(); ?></h1>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="product-photo"><?php mp_product_image(true, 'single', null); ?></div>
<div class="product-details">
<div class="content-box">
<?php the_content(); ?>
</div>
<?php echo framemarket_product_meta(); ?>
<?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); ?>
<?php echo get_the_term_list( $post->ID, 'product_mediums', 'Classified under - Medium: ', ', ', '' ); ?>
<?php echo get_the_term_list( $post->ID, 'product_styles', 'Style: ', ', ', '' ); ?>
</div>
<?php endwhile; else: ?>
<p><?php _e( 'Sorry, no posts matched your criteria.', 'framemarket' ) ?></p>
<?php endif; ?>
<?php comments_template( '', true ); ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer() ?>

Thanks

  • Aaron

    Did you read the themeing readme in the plugin?

    MarketPress searches your current theme folder for template files specific to store pages. If
      a template file does not exist it loads the theme's page template instead. Just like WP, the
      plugin will search for templates in order of priority from top to bottom. Here are possible
      file names for store templates in order:
    
      Single Product Page
        mp_product-PRODUCTNAME.php
        mp_product-PRODUCTID.php
        mp_product.php
    
      Store Page
        mp_store.php
    
      Cart/Checkout Page
        mp_cart.php
    
      Order Status Page
        mp_orderstatus.php
    
      Product List Page
        mp_productlist.php
    
      Product Category List Page
        mp_category-CATEGORYSLUG.php
        mp_category-CATEGORYID.php
        mp_category.php
        mp_taxonomy.php
        mp_productlist.php
    
      Product Tag List Page
        mp_tag-TAGSLUG.php
        mp_tag-TAGID.php
        mp_tag.php
        mp_taxonomy.php
        mp_productlist.php

    Marketpress will look for these files only, in order from top to bottom. If none of them exist for a given page, it will load up the page.php template and use the default virtual page code inserting.

    So in your case you would want to copy mp_taxonomy.php and rename to mp_category-CATEGORYSLUG.php or mp_tag-TAGSLUG.php.

  • M.O.R.E.

    :slight_smile:
    Thanks Arun & Aaron

    Ya I did read all that stuff and after trying various permutations and combinations wrote for some possible solution....it might be I'm missing something...anyways Aaron, did exactly as you told me to do...but m afraid getting the same result....the problem is with the url structure...see this

    When I click on the link "Art and Design" appearing at the bottom of Single Item Description in "Categorized in Art and Design, Paintings | No Tags this is URL I get to see
    moretique.com>moretique.com/store/products/category/art-and-design/

    But when I click on the link "Acrylic" appearing underneath Product Pricing in "Classified under - Medium: Acrylic | Style: Abstract" this is what I see
    moretique.com>moretique.com/product_mediums/acrylic/

    I don't want to treat Medium & Style as Category (well...till such time I find an answer..)....will creating a separate page[taxonomy-slug].php solve this problem then......please pardon me if this is the stupidest question you get to see in your entire career....:slight_smile:

    Thanks

  • M.O.R.E.

    :slight_smile:
    Coding!!!....ME!!!...it might be "Poetry for WP developers" but for me it's pure and simple "Rocket Science"...........:slight_smile: :slight_smile: :slight_smile: :slight_smile:

    In that case why don't you keep this in mind for future updates....can this be treated as a feature request...I know this will make the plugin much better than the rest.....most of the e-commerce plugins has a myopic view on buy/sell function...though I know nothing about coding so I should not lecture the ones who knows...but purely as a consumer's point of view I think the process should provide as much info as possible...so that it appeals to a broader audience

    May be something like a built in "Extra Fields" option so that artists like me can input things like Medium, Style, Materials, Color etc etc

    Let me see whether Custom Fields can achieve what Taxonomy is not been able to

    Thanks

  • M.O.R.E.

    :slight_smile:
    Coding!!!....ME!!!...it might be "Poetry for WP developers" but for me it's pure and simple "Rocket Science"...........:slight_smile: :slight_smile: :slight_smile: :slight_smile:

    In that case why don't you keep this in mind for future updates....can this be treated as a feature request...I know this will make the plugin much better than the rest.....most of the e-commerce plugins has a myopic view on buy/sell function...though I know nothing about coding so I should not lecture the ones who knows...but purely as a consumer's point of view I think the process should provide as much info as possible...so that it appeals to a broader audience

    May be something like a built in "Extra Fields" option so that artists like me can input things like Medium, Style, Materials, Color etc etc

    Let me see whether Custom Fields can achieve what Taxonomy is not been able to

    Thanks

  • M.O.R.E.

    Hi

    What I meant was...

    1) I've created two taxonomies under MP Products....those are "Product Medium" and "Product Style"...two very popular keywords in the ART business

    2) Did whatever is required...so that the uploaded product gets displayed with these taxonomies along with WP's built in taxonomies (category and tag)...so now the product appears with these meta info...

    Categorized in Art and Design, Paintings

    Classified under - Medium: Acrylic Style: Abstract...Click links to know more about Mediums & Styles.

    3) But clicking on these custom taxonomies we can only see the product description and not list of product images...like a store list page

    4) Now according to you none of your template functions are built to handle custom taxonomies

    5) So I was wondering if a way can be found to link those custom taxonomies to some new page where one can read descriptions (content only) to know more about "Art Mediums" or "Art Styles"

    Hope it helps
    Thanks & Regards

  • Aaron

    3) But clicking on these custom taxonomies we can only see the product description and not list of product images...like a store list page

    You would need to create custom theme templates for that.

    5) So I was wondering if a way can be found to link those custom taxonomies to some new page where one can read descriptions (content only) to know more about "Art Mediums" or "Art Styles"

    No it's just how WP works, but I believe it may be possible to turn off the linking by turning off the rewrite argument: http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments

    Another possibiliy is just to use create a http://codex.wordpress.org/Template_Hierarchy#Custom_Taxonomies_display template for each taxonomy, and put your text in there instead of the loop.

  • CastleMediaGroup

    What baffles me is why this was designed with a custom template hierarchy when WP's native template hierarchy seems to cover the same bases better. I cannot get some of these custom templates to load correctly and mp_productlist.php doesnt work at all. I would LOVE to just be able to use archive-product.php and custom style the list there. Why does this need to have a special template hierarchy? I have burned a day on issues caused by this not sticking to the normal Wordpress rules.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.