Home Forums Xi Theme Discussion & Support Gallery Filter Issues

This topic is: resolved

Tagged: , , ,

This topic contains 4 replies, has 2 voices, and was last updated by  themeweaver 4 years, 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #3071

    Daniel Davis
    Participant
    Post count: 3

    I had some questions regarding the gallery filter customization for the XI theme. The biggest issue is that I can get it to show the filter, but whenever I click on a category nothing comes up. You can see what I mean here:

    http://www.buzzfrag.com/gallery

    Secondly, I have a lot of categories in the filter. Is there anyone to pick and choose which ones I want to show? Thanks so much!

    #3074

    themeweaver
    Keymaster
    Post count: 730

    You have to have posts in your categories, preferably with feature images.

    Obviously on most sites not all categories with have images, and some categories (as on your site) are empty, so the best way is :

    1. create a gallery category
    2. create child categories under that category
    3. put your posts in the child catgeories and make sure they have featured images
    4. set the category_name on the gallery page to your parent category

    #3084

    Daniel Davis
    Participant
    Post count: 3

    Actually it seems to be a different issue, possibly a bug. The categories I have that are one word will show up with either pictures or text, but the categories where the category name is more than one word long will not show up. It seems that it’s trying to filter by the litteral category name instead of the category slug.

    For instance, the category called “Web Tips” has a category slug of “web-tips”, but when you click on the filter, the URL query shows up like this:

    http://www.buzzfrag.com/gallery/?category_name=Web%20Tips

    which returns a null value. Instead the query should search for the category slug like this:

    http://www.buzzfrag.com/gallery/?category_name=web-tips

    When I adjusted the URL to this query, the Web Tips category shows up. Just thought I’d share. Hopefully there’s a simple fix for this. If I find one, I’ll be sure to share it.

    #3085

    Daniel Davis
    Participant
    Post count: 3

    Ok, I found a simple solution. In “template-gallery-full.php” (child theme of course), Line 45, I changed the link code that says:

    add_query_arg( ‘category_name’, $category->cat_name)

    to

    add_query_arg( ‘category_name’, $category->slug )

    This worked for me, but you can test it out and see if it’s worthy of implementing into the theme.

    #3088

    themeweaver
    Keymaster
    Post count: 730

    OK thanks for this.

    add_query_arg( ‘category_name’, urlencode($category->cat_name) )

    will also do it and may be better for now since users enter category_name for parent category in the custom field if required.

    We’ll test it out further and update the theme.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.