Jump to content


in progress

What Is The Proper Terminology For Calling An Exchange Category?

custom template product categories

1 reply to this topic

#1 psillari

psillari

    New Member

  • Members
  • Others: BackupBuddy, Exchange - Stripe, Premium Exchange Addon
  • 3 posts

Posted 03 June 2014 - 07:48 PM

I’m attempting to write a custom template.

My starting point is the following code

<?php

/* Template Name: Articles Template */

/** Replace the standard loop with our custom loop */
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'wnd_do_custom_loop' );

function wnd_do_custom_loop() {
global $paged; // current paginated page
global $query_args; // grab the current wp_query() args
$args = array(
	 'cat' => 8, /* shows all posts and child posts from category id */
	 'paged'		 => $paged, // respect pagination
);

/* If you want to show posts from a category only and no subcategory posts, use 'category_name' => 'category-slug', instead of 'cat' => 8, for example, 'category_name' => 'articles', */
genesis_custom_loop( wp_parse_args($query_args, $args) );
}
	
genesis();

Doing this results in a display of only the posts from the blog category with the ID of 8.

I can even use the category slug by using ‘category_name’ => ‘business-stained-glass’ instead of ‘cat’ => 8 and get the same result.

However when I use an Exchange Product Category ID of “84” I don’t get the Exchange product category “Roses”.

Here’s the detail for one of my Exchange Product Categories
Product Category Name – Roses
Product Category Slug – roses-prod
Product Category ID  – 84

I tried ‘category_name” => ‘roses-prod” but wasn’t able to display the Roses category that way either.

It looks to me like I am not using the appropriate terminology to specify the Exchange product categories.

What terms should I be using?

Is there a reference document that lists or shows me what the correct names for category elements are?

Help is appreciated.

Pete

#2 Ronald

Ronald

    Forum Admin

  • Administrators
  • Others: All Plugins, All Themes, Moderators, Webdesign
  • 29,985 posts

Posted 09 June 2014 - 03:00 PM

Hi Pete,

Exchange products are a Custom Post Type (CPT), and the category is a taxonomy for that CPT. Here's more information on how to use that in a custom WordPress query: http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters

hope that helps,
Ronald

Join the iThemes Builder Community on Google+.



To ensure that we can process your support request efficiently, ALWAYS include a link to your site, and/or the page your request is related to. Please also read the forum guidelines.



When asking your question/posting your request on the forum, please be as concise and specific as possible. The shorter your request, the more to the point, the more specific, the easier it will be for us to try and help out.




Reply to this Topic


ATTENTION
If this topic is marked RESOLVED or INFORMATION, or if you are NOT experiencing EXACTLY the same issue, please start a new topic to provide the details of your problem. If the solution provided doesn't work for you, you should start a new topic. If you feel this thread contains relevant information, you may include a link to it in your new topic. To ensure that we can process your support request efficiently, ALWAYS include a link to your site, and/or the page your request is related to. When posting your question or request on the forum, please be as concise and specific as possible. The shorter and more to the point you can make your request, the better.

For BackupBuddy related issues, be sure to include the status log from your most recent backup.

CLICK HERE to start a new topic in the Exchange ecommerce plugin forum.


  



Also tagged with one or more of these keywords: in progress, custom template, product categories

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users