making thumbnails function as a sub-navigation tool
I decided to use Black Canvas to build a site for an artist who works with glass (www.frankzika.com) because the thumbnails appeared to offer an elegant, visual sub-navigation system for viewing individual examples of his work within two separate categories, Architectural and Sculptural. However, after building the site, I discovered that although the thumbnails for each category appear along the bottom of the page when the user first selects the category from the drop-down menu (under "Portfolio"), once the user clicked on any thumbnail in that category, all the category-specific thumbnails were replaced with thumbnails from all categories (in this case, from both Architectural and Sculptural categories in order of the most recently posted).
What I would like to have happen here is to maintain the thumbnails from the current posts/current photos for the selected category (i.e., have the thumbnails work as a sub-navigation tool within the selected category) and never have the option of seeing all the recent posts/recent photos, which happens now when the user clicks on any of the thumbnails in, say, the Architectural category. Currently, clicking on any of the thumbnails in the Architectural category (which were the first photos/posts I posted) results in the most recent photos/posts posted (which are in the Sculptural category). I want the user to be able to use the thumbnails as a sub-navigation tool within the category and, if they want to check out the other category, they go to the primary nav bar, select the alternate category, and have the same inter-category click-ability.
Thanks for help with this. It appears to be a loop issue linked to recent.php (and other files?).
You will have to modify the recent.php loop. This will involve two things:
1. Detect which category the currently viewed post belongs to,
2. Pass this category ID to the WP_Query loop in order to populate the thumbnails with posts which belong to the same category.
For no.1, have a look at the get_the_category() function.
One thing to consider is whether posts are only ever assigned to one category. If not, things get more complicated.
Because I am not a php programmer, I hope you can help me with the relevant code for the recent.php document and perhaps index.php. I'm not sure how to "Detect which category the currently viewed post belongs to," or how to "Pass this category ID to the WP_Query loop in order to populate the thumbnails with posts which belong to the same category."
From what I can tell from the Codex, a solution for my issue might rest with the index.php file and the specific manner the Loop understands how to access different categories in different ways. Since www.frankzika.com will only ever have two categories (architectural and sculptural), can I get some help generating code to create separate template files for each category (see Codex below), so, in a sense, because they don't even know about each other they can't ever access the files from the other category.
Codex: Different Formats for Different Categories
As explained in the Template Hierarchy, it is possible to create separate template files for each category. Simply name the file category-X.php, where X is the numerical ID of the category. Consider carefully whether you need a whole new template for a specific category.
Here's more that might be linked to this issue? I'm at the upper end of my WordPress understanding by even figuring out how to ask this question.
Codex: Different Category Format
Like the archive views, WordPress looks for a separate template file for category views. If a visitor clicks on a link for a category in your blog, they will be taken to the category view. WordPress will prepare The Loop with posts from that category only, limiting the number of posts per the blog's default settings.
I am also interested in doing something similar. Do you have specific coding that needs to be changed in the WP_Query loop in order to get this to work?
It doesn't appear as if Rachel ever solved this issue.
Is all the coding that determines which thumbnails show up located within the recent.php? Or is there another place to look?
|All times are GMT -5. The time now is 07:09 PM.|
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.