Global Category menu

Hi,

in apperence menu is it possible to get the “Global Product Category List” to show up so it possible to use it for custom menus? As the Product Category is there maybe is away to show the global also.

  • Mason
    • DEV MAN’s Sidekick

    Hiya,

    No. That's not possible, but you can create a custom link to go to whatever ya like. Attached screenshot to show. As long as you have a page with the global categories, you can just create a custom link to it (or any link ya like) right inside the menu.

    Thanks!

  • DavidM
    • DEV MAN’s Mascot

    Hi erikjohansson,

    There’s not a way to do that as far as I can see. The global features of MarketPress aren’t really something WordPress itself was designed to handle.

    However, categories can definitely be entered into your menus as Custom Links. You could grab the url of the respective category then add a label to it and save.

    Have you tried that?

    Cheers,

    David

  • Mason
    • DEV MAN’s Sidekick

    Hiya,

    Using the custom links will have to be done manually and it won’t know whether or not there are no products, so you’d have to watch for that yourself.

    It would take some custom coding to find a way to add the global categories to be available as menu items in the backend. If you want to display a list of global categories on the front end you could just add it to your theme’s menu nav template.

    For example, you could take this snippet from GridMarket and adapt it to make a list in your menu:

    <?php
    if ( $slug = get_query_var('global_taxonomy') ) {
    $args = array();
    $args['echo'] = false;
    $args['category'] = $slug;

    //check for paging
    if (get_query_var('paged'))
    $args['page'] = intval(get_query_var('paged'));

    $content = framemarket_mp_list_global_products( $args );
    $content .= get_posts_nav_link();

    } else { //no category set, so show list
    $content .= mp_global_categories_list( array( 'echo' => false ) );
    }
    echo $content;
    ?>

    That only works on child theme’s of framemarket, but you should be able to modify it easily to work with any theme.

    Thanks!

  • Mason
    • DEV MAN’s Sidekick

    Hiya,

    It would depend on your particular theme. If you want this list to appear in your sidebar, you’d look for sidebar.php for example.

    It falls into the area of custom development. A coder should be able to handle this easily for you. As I said above this code snippet has a dependency on framemarket (framemarket_mp_list_global_products) so you’d want to copy that function from framemarket and bring it into your theme as well.

    If you’re looking for some assistance with that I’d check out our job boards here:

    https://premium.wpmudev.org/wpmu-jobs/

    Thanks!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.