Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Custom Post Type?

  • This topic is empty.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #38342
    chrisburton
    Participant

    I’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-1

    Along 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?

    #103871
    Senff
    Participant

    I 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.

    #103892
    chrisburton
    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

    #103896
    chrisburton
    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.

    #103900
    chrisburton
    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

    #103905
    chrisburton
    Participant

    All 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?

    #103907
    Senff
    Participant

    I 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();
    #103908
    chrisburton
    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();
    ?>

    #103909
    Senff
    Participant

    @christopherburton Damn man, there’s TWO f’s in my name!!! You keep making the same mistake! ;)

    #103910
    chrisburton
    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.

    #103912
    Senff
    Participant

    I put this together fairly quickly, I’m sure the script can be done better, but it’s a start: http://jsfiddle.net/senff/9Xwhj/

    #103914
    chrisburton
    Participant

    @Senff Thank you!!! #lifesaver

Viewing 12 posts - 1 through 12 (of 12 total)
  • The forum ‘Other’ is closed to new topics and replies.