A A A

Please consider registering
guest

Log In Register

Login form protected by Login LockDown.


Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
How to change category order on grid view
July 11, 2011
12:27 pm
Member
Forum Posts: 168
Member Since:
August 11, 2010
Offline

Is there any way to order the categories on the grid view template so you can place them where you want?

July 11, 2011
9:18 pm
Admin
Forum Posts: 5051
Member Since:
March 16, 2008
Offline

This post actually belongs in the "support" forum.  (The "How to" forum is for finished instructions on how to do things — not questions)

 

Anyway, the "grid-view" template doesn't actually show categories, but products themselves.

If you want to change the order of the product images on the grid-view page, then you just need to modify on or around line #34 of the "gridview.php" file where it says:

 

$wp_query->query('orderby=title&order=asc&cat='.$grid_cat_id.'&showposts='.$mkt_options['mkt_grid_thumbs_per_page'].'&paged='.$paged);

The "orderby" value can be changed to different values as described here:

http://codex.wordpress.org/Cla…..Parameters

July 12, 2011
12:29 am
Member
Forum Posts: 168
Member Since:
August 11, 2010
Offline

Thanks for answering.  I think I'm using the wrong term for the template.  What I want is to change the order of the categories images on the storefront homepage (that are in groups of 3).  Please advise.  Also feel free to move the post if necessary.

July 12, 2011
6:03 pm
Admin
Forum Posts: 5051
Member Since:
March 16, 2008
Offline

Yes, the storefront homepage template makes more sense.  It's the "frontdoor.php" file.

In this case, the line to change is on #14 where it says:

 

<?php     $my_query = new WP_Query('cat='.$mkt_options['product_cat'].'&showposts='.$mkt_options['mkt_newprods_storefront']); 

You can reference the page:

http://codex.wordpress.org/Cla…..Parameters

for the parameters you can use to modify the "orderby" process.  This parameter is currently not shown in the link, so you'd need to add it in yourself.

 

I hope this helps.

July 13, 2011
3:09 pm
Member
Forum Posts: 168
Member Since:
August 11, 2010
Offline

Not sure exactly how to add the "orderby" code, but even if I did this seems to be for posts as it uses parameters such as date which I can't change for a category.  Is there any way I can have control over the order and not be dependant on alphabetical order or other parameters I can't change?  I need to be able to group 3 categories of a certain type in the rows I choose.

July 13, 2011
6:52 pm
Admin
Forum Posts: 5051
Member Since:
March 16, 2008
Offline

If you're  asking if there is a built-in way that you can define the order of categories manually, I don't think there is.  Categories in Wordpress don't have a "sort order" like posts do.

A possible work around, is to rename the category name to begin with a number.

Sort of like this:

 

1)  Category name

2)  Category Name

3)  Category Name

 

Other than that, I don't know.  A coder could go in and hard code so that certain category IDs showed up in a certain order, but nothing I can offer in the way of that code.  Sorry.

July 14, 2011
1:31 pm
Member
Forum Posts: 168
Member Since:
August 11, 2010
Offline

I found a way to do this that will not be visible to visitors.  The categories are alphabetically ordered by slug and not category name.  If you alphabetically preface the category slug names with:

 

a-category-name

b-category-name

c-category-name

 

you can make whatever order you want.

July 15, 2011
4:24 am
Admin
Forum Posts: 5051
Member Since:
March 16, 2008
Offline

Great idea! Thanks for posting.

November 12, 2011
12:04 am
Member
Forum Posts: 10
Member Since:
October 22, 2011
Offline

I was so hopeful that prefacing the category slug with a/b/c… would change the order of display on the front page grid, but it didn't work for me. Any other ideas? Thank you!

November 15, 2011
10:20 pm
Admin
Forum Posts: 5051
Member Since:
March 16, 2008
Offline
10

Did you change the code, so that it sorted by category slug?

 

The idea you mentioned would have 2 elements.

 

1.  naming the category slugs appropriately with letters (a-category, b-category, c-category, etc.)

2. Editing the code, so that it sorted by category slug, instead of the default method.

November 18, 2011
10:06 pm
Member
Forum Posts: 9
Member Since:
November 2, 2011
Offline
11

So, is the necessary code change still In frontdoor.php on line 14?
Not sure how to change code for sorted by slug as I didn't see that option spelled out in the codex link.
Help greatly appreciated.

November 21, 2011
10:45 pm
Admin
Forum Posts: 5051
Member Since:
March 16, 2008
Offline
12

Sorry, I may have provided bad information initiall on this one.

 

You may need to alter lines on or around #1681 through #1685 in the "functions.php" file where it says:

            // show all category children and grandchildren
            $productCats = get_categories('hide_empty=0&child_of='.$cat);
        } else {
            // show only direct category children
            $productCats = get_categories('hide_empty=0&parent='.$cat); 

Just add in the "orderby" parameter like this:

            // show all category children and grandchildren
            $productCats = get_categories('orderby=slug&hide_empty=0&child_of='.$cat);
        } else {
            // show only direct category children
            $productCats = get_categories('orderby=slug&hide_empty=0&parent='.$cat); 

 

Make sure to save the file.

 

This is the Wordpress Codex page for the "orderby" info.

http://codex.wordpress.org/Fun…..categories

 

I think that's better.

November 28, 2011
6:19 pm
Member
Forum Posts: 9
Member Since:
November 2, 2011
Offline
13

Thanks Admin!

Works like a charm.

Left menu didn't change order, of coursre. Would order by parameters for it also be in functions.php?  I searched through much of the code but wasn't positve on exactly which lines pertained to left menu.

November 28, 2011
11:27 pm
Admin
Forum Posts: 5051
Member Since:
March 16, 2008
Offline
14

For the left menu area, just look in the "sidebar.php" file.

 

Just change the "orderby=" parameter to "slug" I expect.

Forum Timezone: UTC 0

Most Users Ever Online: 40

Currently Online:
21 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

icy1: 2371

wreed06: 175

laurie390: 168

StitchTek Services, LLC: 144

boutiqueelliette: 130

yiorgos: 127

Member Stats:

Guest Posters: 428

Members: 2252

Moderators: 1

Admins: 1

Forum Stats:

Groups: 1

Forums: 4

Topics: 2983

Posts: 16042

Moderators: Market Admin (5051)

Administrators: Market Admin (5051)

Market takes e-commerce to the next level with an easy to use, quick setup platform. Learn more or take the tour.