Create Template Pages "single-product.php" ect...

I am having a problem creating a custom template for the "products".

As you know WordPress has template files in place such as "archive.php", single.php, category.php

As I understand and am currently doing on my website is created a custom template an have full control over a custom post type like this. "single-my_custom_post_type".

This works just fine but for some reason with the Marketpress plugin I cannot call out "single-product". This should allow me to manipulate that particular template. I have looked into the "marketpress.php" file to confirm the exact name of the custom post type name registered in your plugin.

Please advise why this is not working for me and how to accomplish what I am trying to do.

Thanks!

  • Elliott Bristow

    Hi @drewshane12,

    The plugin includes a .txt file that provides some light on this subject. It's stored in the /plugins/marketpress/marketpress-includes/themes folder, called Themeing_Marketpress.txt

    The following is a quote from this file:

    MarketPress uses custom post types to display it's products. This means that you can use the same WP theme templating system you are familiar with. We simply provide a customized subset of template functions so you don't have to worry about dealing with post meta. Template functions are fully documented and can be found in the /marketpress/marketpress-includes/template-functions.php file.

    E.g. to create a custom product page:

    1. Make a copy of the page.php template file in your theme directory and rename it mp_product.php

    2. mp_product.php must use the mp_* functions instead of the_content(), see template-functions.php for a list of functions relevant to products.

    I hope that explains it for you. Please let us know if you have any other issues... otherwise let us know that it worked and mark this thread as resolved!

    Thanks

    Elliott