[mp_global_categories_list] is it possible to show only one categorie?

hi,

i want to use the [mp_global_categories_list] shortcode, but i wonder if i can add some atribute in to it to only show one of my categoreis.

example; [mp_global_categories_list category=”fashion”] is it possible to do this with right atribute code offcourse?

  • erikjohansson
    • The Incredible Code Injector

    i wanted to add this to above post as my explantions are always crap.

    I want to be able to display only subcategories of a particular category whit a global shortcode maybe somethig like this mp_list_categories( array( ‘child_of’ => 10 ) ) as i am not coder so i wonder if this possible?

    here is expalntions but i can’t understand if it will work.

    http://codex.wordpress.org/Template_Tags/wp_list_categories#Only_Show_Children_of_a_Category

  • Mason
    • DEV MAN’s Sidekick

    Hiya erik,

    MarketPress doesn’t provide for a ‘child of’ argument for the global listing. It would have to be custom coded fro you. Using something like you mentioned above would work though:

    [mp_global_categories_list category="fashion"]

    That will probably be your best bet. Take a look at marketpress-ms.php line 1217 to see the available arguments for the global shortcode. You could also add a tag to all your child-category products as an alternate method.

    Thanks.

  • erikjohansson
    • The Incredible Code Injector

    Hi again,

    i find the arguments and wonder what i can use in to the shortcode [mp_global_categories_list category=”fashion”]

    you say add a tag? if i add tag to child category that is called “shoes” then where do add that tag in to the shortcode?

    function mp_list_global_products( $args = '' ) {
    global $wpdb, $mp;

    $defaults = array(
    'echo' => true,
    'paginate' => true,
    'page' => 0,
    'per_page' => 20,
    'order_by' => 'date',
    'order' => 'DESC',
    'category' => '',
    'tag' => '',
    'show_thumbnail' => true,
    'thumbnail_size' => 150,
    'context' => 'list',
    'show_price' => true,
    'text' => 'excerpt',
    'as_list' => false
    );

  • erikjohansson
    • The Incredible Code Injector

    Hi :slight_smile:

    is tag same us Slug? i just relize that i cant find any tags on my product categories.

    is it is possibel to show only one product categorie? i have a categorei that is called Albums and when i add the shotcode to a page like this

    [mp_global_categories_list category=”Albums” tag=”Albums” include=”both”]

    i get all the categoreis showing up with product in them. When i should only show Albums product right?

  • erikjohansson
    • The Incredible Code Injector

    let me refresh this question.

    i want to show only one specific global category list with shortcode.

    i have now tried like this [mp_global_categories_list category=”here i add my category name”] but is not working.

    when i try the above it shows all the categoreis that is not related to the one i have added in shortcode.

    any ideas please.

  • Mason
    • DEV MAN’s Sidekick

    Hiya erik,

    Sorry, I was getting confused between [mp_global_categories_list] and [mp_list_global_products].

    You can’t define a specific category when listing categories (that would only list one category). If you want to show the products of one category you’d use [mp_list_global_products category=”whatever”]

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.