StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
  #1  
Old 05-05-2010, 01:33 PM
rduchak rduchak is offline
Registered User
Genesis Member
Pro Plus Member
 
Join Date: Oct 2009
Posts: 91
Default making thumbnails function as a sub-navigation tool

Hi.

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?).
  #2  
Old 05-06-2010, 12:38 PM
adew adew is offline
Community Moderator
 
Join Date: Oct 2008
Location: Genève, Suisse
Posts: 14,270
Default

Hi,

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.
__________________
Ade
Themessence - Studiograsshopper

WordPress plugins: Dynamic Content Gallery | Reveal Page Templates | Custom Taxonomies Menu Widget

Check out the Genesis and Child Theme tutorials before posting your question - and please provide YOUR URL!
Make Andrea happy - read her Firebug tutorial and save yourself loads of time and effort.
  #3  
Old 05-09-2010, 06:41 PM
rduchak rduchak is offline
Registered User
Genesis Member
Pro Plus Member
 
Join Date: Oct 2009
Posts: 91
Default

Hello.

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.

Rachel


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.
  #4  
Old 06-21-2010, 04:19 PM
ecsphotography ecsphotography is offline
Registered User
 
Join Date: Jun 2010
Location: Denver, CO
Posts: 3
Default

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?

Thanks,
Eric
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Making "more" jump function work. edforbes02 General Discussion 1 03-18-2009 06:33 PM
Menu Tooltips Making Navigation Harder goldkey General Discussion 1 01-06-2009 06:46 AM


All times are GMT -5. The time now is 11:07 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.