- This topic is empty.
-
AuthorPosts
-
June 4, 2012 at 8:24 am #38342
chrisburton
ParticipantI’m not sure the right way to go about this or how to go about this in WordPress. Essentially what I want to do is have a Portfolio page that has both Lettering and Typography pieces of my work.
example
Now, when you click on any one of these images, it will bring you to their specific page. The link would look something like this:
mydomain.com/lettering/title-1
not this: mydomain.com/portfolio/lettering/title-1Along with that, I need that page to have a large image with 3 thumbnail images for process shots. When you click on any of those 3 thumbnails, that large image should change accordingly. Make sense?
Here is a visual
I’m not sure if I need a custom post type or exactly how to go about this. Any ideas?
June 4, 2012 at 1:30 pm #103871Senff
ParticipantI would go with custom post types for sure. If you create two types of custom posts (one called “lettering” and one called “typography”), the links would definitely be like this:
http://www.mydomain.com/lettering/example-thing
http://www.mydomain.com/lettering/another-example
http://www.mydomain.com/lettering/and-another-one
http://www.mydomain.com/typography/typo-example
http://www.mydomain.com/typography/second-example
http://www.mydomain.com/typography/final-example
etc. etc.Your portfolio page can be created so that it just lists posts from those custom post types.
Personally, I like the plugin “Custom Post Type UI”, which lets you create custom post types very easily. If you want, you can have both types to use different templates too. Normally, a custom post type will just use the default archive.php and single.php as their templates. However when you just drop archive-lettering.php and single-lettering.php in your directory, WordPress will use those files for those types, so you can customize the templates for those.
June 4, 2012 at 9:40 pm #103892chrisburton
Participant@senf Thank you! I’m going to take a look at that and see what I can come up with. I really appreciate it
June 4, 2012 at 10:56 pm #103896chrisburton
Participant@senf Wait, how do I attach the custom post types to my Portfolio page I created in the backend?
Edit: Or what I mean is, how can I add the content from both custom post types to my Portfolio page? I would prefer that they’re not separated content. Meaning, if I add something to Typography, it will show up right next to a Lettering piece. Example show above with thumbnails.
June 5, 2012 at 12:45 am #103900chrisburton
Participant@jknetdesign Mind cleaning that post up a little so I can read it better? Just throw your code between the pre, code tags like this:
Put code here code> pre>
June 5, 2012 at 7:11 am #103905chrisburton
ParticipantAll right. I figured everything out except one thing. Thanks @senff
How can I add ALL post_thumbnails from both Custom Post Types into my Portfolio template/page?
June 5, 2012 at 9:12 am #103907Senff
ParticipantI think you can do a query to show only posts from those two types (if that’s what you meant):
query_posts( array( 'post_type' => array( 'lettering', 'typography'), 'posts_per_page' => -1) );
while ( have_posts() ) : the_post();
echo ''; // [OR WHATEVER YOU WANT TO PLACE HERE FOR EACH POST]
endwhile;
wp_reset_query();
June 5, 2012 at 9:16 am #103908chrisburton
Participant@senf
I ended up using the code below. I appreciate all your help, man.
$loop = new WP_Query( array( 'post_type' => array('lettering', 'typography')&'post_status=publish'));
while ( $loop->have_posts() ) : $loop->the_post();
?>
June 5, 2012 at 9:31 am #103909Senff
Participant@christopherburton Damn man, there’s TWO f’s in my name!!! You keep making the same mistake! ;)
June 5, 2012 at 9:39 am #103910chrisburton
Participant@Senff Ha! Sorry about that. I got everything worked out perfectly though. Just need to figure out the javascript/jQuery part to hiding those images. I really hate development sometimes.
June 5, 2012 at 10:33 am #103912Senff
ParticipantI put this together fairly quickly, I’m sure the script can be done better, but it’s a start: http://jsfiddle.net/senff/9Xwhj/
June 5, 2012 at 10:39 am #103914chrisburton
Participant@Senff Thank you!!! #lifesaver
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.