Title: Broken Category/Sort function for Gallery page
Last modified: February 1, 2017

---

# Broken Category/Sort function for Gallery page

 *  Resolved [novi4polybldg](https://wordpress.org/support/users/novi4polybldg/)
 * (@novi4polybldg)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/broken-categorysort-function-for-gallery-page/)
 * Hi!
 * This is my first time posting (and I hope I’m posting this at the right place;
   otherwise just let me know and my apologies in advance), I desperately need help
   to find out why my company’s WordPress website’s Category/Sort function for the
   gallery page is not working.
 * —[http://www.polybuilding.com.sg/types-of-stones/](http://www.polybuilding.com.sg/types-of-stones/)
 * Clicking ‘Marbles’ and ‘Travertines’ return me with an empty Gallery.
 * For example, this product page:
    —[http://www.polybuilding.com.sg/gallery/grigio-carnico/](http://www.polybuilding.com.sg/gallery/grigio-carnico/)
   has technically been ticked under ‘Marbles’ in the Gallery Categories; however,
   it’s not turning up in the Gallery at all.
 * I’m tasked with adding a new Category (i.e. ‘Cambria Quartz *NEW*’) but I’m unable
   to proceed because of this broken Category/Sort function.
 * I have updated my WordPress to the latest 4.7.2, and according to research, this
   website is using a paid Grandis theme from Orange Themes.
 * A little backstory if it somehow helps; the company who did this WordPress website
   has closed down quietly, momentarily shutting down my company website as well.
   The IT dept has tried their best to salvage much of the website, and by the time
   I came to this company, I already found the WordPress website to be slightly 
   buggy. The broken Category/Filter function bugs me the most as I couldn’t find
   any solution to this basic Gallery function.
 * I’m unable to contact Orange Themes tech support as I didn’t have the login details
   to verify the ownership of the website and they didn’t respond to any of my emails.
 * Any advice to fix this issue would be very much appreciated.. Thanks! 🙂

Viewing 11 replies - 1 through 11 (of 11 total)

 *  [gnoric](https://wordpress.org/support/users/gnoric/)
 * (@gnoric)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/broken-categorysort-function-for-gallery-page/#post-8723830)
 * Hard to say, really as all the other filters are working, including your new 
   one. Have you tried adding the categories anew, and then removing the old ones?
   Without seeing the data structure or the responsible code, it is very difficult
   to get to any proper conclusion.
 *  Thread Starter [novi4polybldg](https://wordpress.org/support/users/novi4polybldg/)
 * (@novi4polybldg)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/broken-categorysort-function-for-gallery-page/#post-8727647)
 * [@gnoric](https://wordpress.org/support/users/gnoric/) Yeah, I’ve tried adding
   a new category _(i.e.‘Cambria Quartz *NEW*’)_, but none of my pages show up in
   that selected category.
 * Quite a number of pages that are Gallery-categorised under e.g. ‘Exotic Stones’,
   do turn up under Exotic Stones, while I have some pages that belong under ‘Granite’,
   end up turning up at ‘Exotic Stones’ instead..
 * I tried looking up for the codes _[Appearance > Editor > Stylesheet (style.css)]_
   but I don’t see a particular set of codes that belong to the Gallery; how can
   I have access and edit the codes for the Gallery page?
    -  This reply was modified 9 years, 3 months ago by [novi4polybldg](https://wordpress.org/support/users/novi4polybldg/).
 *  [gnoric](https://wordpress.org/support/users/gnoric/)
 * (@gnoric)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/broken-categorysort-function-for-gallery-page/#post-8729152)
 * Can you copy paste your whole page content (from the editor’s text view) you 
   have on the filter page? While you have 8 “menu items” you only have 7 tabs that
   can be shown, from which one is empty. I presume you are using some sort of shortcode
   to display what you are displaying.
 * If that is the case, and you know where to find that shortcode’s code, please
   copy and paste that also.
    -  This reply was modified 9 years, 3 months ago by [gnoric](https://wordpress.org/support/users/gnoric/).
 *  Thread Starter [novi4polybldg](https://wordpress.org/support/users/novi4polybldg/)
 * (@novi4polybldg)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/broken-categorysort-function-for-gallery-page/#post-8732635)
 * Under _Appearance > Editor > Templates >_ I believe I the following codes belong
   to the **Gallery Template page** codes as it contains wordings of the menu items_[
   i.e. All Items, Cambria Quartz *NEW!*, Exotic Stones, Granites, Limestone, Marbles,
   Onyx, Travertines]._ However I’m not quite sure where can I find a particular
   page content belonging to a Filter page..
 * **Grandis Premium Theme: Photo Gallery Page Template (template-gallery.php)**
 * _[ redacted ]_
    -  This reply was modified 9 years, 3 months ago by [novi4polybldg](https://wordpress.org/support/users/novi4polybldg/).
    -  This reply was modified 9 years, 3 months ago by [novi4polybldg](https://wordpress.org/support/users/novi4polybldg/).
    -  This reply was modified 9 years, 3 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
 *  Thread Starter [novi4polybldg](https://wordpress.org/support/users/novi4polybldg/)
 * (@novi4polybldg)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/broken-categorysort-function-for-gallery-page/#post-8732658)
 * If this helps, the following codes should belong to the **individual Gallery 
   item Template** (eg. Blue Bahia stone from _`http://www.polybuilding.com.sg/gallery/
   blue-bahia/`_)
 * This individual Gallery item Template is not without its frustrating bugs, the
   fact that the thumbnails images are broken/unresponsive (to access the next image
   you can only use left-right keyboard arrows or click on the full image itself)
   but let’s not get to that for now..
 * **Grandis Premium Theme: gallery-single-style-1.php (includes/gallery-single-
   style-1.php)**
 * _[ redacted ]_
 *  [gnoric](https://wordpress.org/support/users/gnoric/)
 * (@gnoric)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/broken-categorysort-function-for-gallery-page/#post-8733697)
 * [@admin](https://wordpress.org/support/users/admin/), can you please fix formatting
   as his code broke the page.
 * [@novi4polybldg](https://wordpress.org/support/users/novi4polybldg/) can you 
   please use the “code” tags when pasting code. Like this it is almost impossible
   to read.
    To use the code tags just click on the code button before and after
   your code. This should give you ´´ <– these just the other way around.
    -  This reply was modified 9 years, 3 months ago by [gnoric](https://wordpress.org/support/users/gnoric/).
 *  [gnoric](https://wordpress.org/support/users/gnoric/)
 * (@gnoric)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/broken-categorysort-function-for-gallery-page/#post-8733829)
 * Had a thorough look through what you pasted and to say the least, it is not very
   well coded.
    1. You run a DB query for each category separately. This makes your
   site unnecessarily slow. 2. The category names are hardcoded into your theme.
   Adding a category requires adding php. 3. You seem to be editing the main theme,
   not aa child theme. You are aware that this will break if the theme ever gets
   updated?
 * Maybe you raise these issues with the theme developer, and get him to fix it.
   
   If you truly wanted a proper fix, you should contact a pro developer like myself
   to code you a proper solution. If you want to keep the “not so nice” code, and
   just be pointed in the direction to “make it work”, you need to look for the 
   code bits starting with `global $post` and ending with `<?php } ?>`. This currently
   repeats 7 times. Once for “all categories” and then for each category one by 
   one. You should see the category names in the query (except the first one). It
   looks like this: `$getallcat = new WP_Query(array(“post_type” => “gallery” , “
   gallery-cat” => “exotic-stones” , “posts_per_page” => -1));`
 * You need to have 9 code blocks like that, and in the right order.
    -  This reply was modified 9 years, 3 months ago by [gnoric](https://wordpress.org/support/users/gnoric/).
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [9 years, 3 months ago](https://wordpress.org/support/topic/broken-categorysort-function-for-gallery-page/#post-8733895)
 * > can you please fix formatting as his code broke the page.
 * Done. Next time just tag the topic with `modlook`.
 * I redacted the code. Don’t add that again, this topic is not for these forums.
 * For pro or commercial product support please contact the author directly on their
   site.
    _ *Looks*
 * I’m sorry but that theme does not appear to supported. You’ll need to look for
   another theme or contact the author somehow.
 * As the author is aware, commercial products are [not supported in these forums](http://codex.wordpress.org/Forum_Welcome#Commercial_Products).
   As you are their customer I am sure they will have no problem supporting you 
   there.
 *  Thread Starter [novi4polybldg](https://wordpress.org/support/users/novi4polybldg/)
 * (@novi4polybldg)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/broken-categorysort-function-for-gallery-page/#post-8742368)
 * [@gnoric](https://wordpress.org/support/users/gnoric/) Thank you so much for 
   your explanation (Especially point no.3)! As I’m not proficient in codings, identifying
   the root issues will at least help shed some light on the situation. I’ll try
   to read up on the issues you’ve raised up and see what I can do.. Appreciate 
   your kind help and time.
 * [@jdembowski](https://wordpress.org/support/users/jdembowski/) Noted and apologies
   for the missing ‘code’ tags & wrong forum posted, will keep that in mind. There
   is no way for me to contact the theme developer (Orange Themes) as they only 
   accept tech support request for customers with registered email address/ username,
   in which unfortunately I have none as there wasn’t a proper handover before the
   web company shut down suddenly. Orange Themes hasn’t been responding to my emails
   or social media messages as well for the past weeks.
 * But it’s alright, I’ll see what else can be done. Thanks both 🙂
    -  This reply was modified 9 years, 3 months ago by [novi4polybldg](https://wordpress.org/support/users/novi4polybldg/).
    -  This reply was modified 9 years, 3 months ago by [novi4polybldg](https://wordpress.org/support/users/novi4polybldg/).
    -  This reply was modified 9 years, 3 months ago by [novi4polybldg](https://wordpress.org/support/users/novi4polybldg/).
 *  [gnoric](https://wordpress.org/support/users/gnoric/)
 * (@gnoric)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/broken-categorysort-function-for-gallery-page/#post-8742580)
 * if you need further assistance, drop me an email as Jan is right, this does not
   fall under wp suport. [username]@gmail.com
    -  This reply was modified 9 years, 3 months ago by [gnoric](https://wordpress.org/support/users/gnoric/).
 *  Thread Starter [novi4polybldg](https://wordpress.org/support/users/novi4polybldg/)
 * (@novi4polybldg)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/broken-categorysort-function-for-gallery-page/#post-8746815)
 * [@gnoric](https://wordpress.org/support/users/gnoric/) Cool, I’d review the website
   again and will contact you should I’m still unsure with things again. Thanks 
   man.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Broken Category/Sort function for Gallery page’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 11 replies
 * 3 participants
 * Last reply from: [novi4polybldg](https://wordpress.org/support/users/novi4polybldg/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/broken-categorysort-function-for-gallery-page/#post-8746815)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
