Image Upload, PDF Upload and Custom Post Order

Hi, having downloaded Custompress for the first time I have three specific requirements and am hoping to get a 'yes', 'no' or 'this is how' for each of these 3 issues if possible. Any help would be greatly appreciated:

(1) The ability to add 2 images to a custom post. The first one on a page that shows a summary of each custom post within a taxonomy and the next one a 'detail' page showing the full custom post.

(2) The ability to upload a PDF specification doc to the full post page for download.

(3) The ability to set a specific order of appearance for the custom posts, so rather that alphabetically or my date, an order of my choice.

Thanks in advance.
David

  • Philip John
    • DEV MAN’s Apprentice

    Hiya!

    (1) The ability to add 2 images to a custom post. The first one on a page that shows a summary of each custom post within a taxonomy and the next one a 'detail' page showing the full custom post.

    So, it sounds like what you need here is a custom taxonomy page showing each post with an excerpt and the featured image. Read this to learn how to create a custom taxonomy archive page and then how to use featured images.

    Then, each post you could simply add the second image within the content of the post, as opposed to the excerpt.

    (2) The ability to upload a PDF specification doc to the full post page for download

    Simple, just click on the add media option and upload your doc. Then you can simply link to it from the post.

    (3) The ability to set a specific order of appearance for the custom posts, so rather that alphabetically or my date, an order of my choice.

    Try the Post Types Order plugin for this.

    Cheers!
    Phil

  • fortyfivecreative
    • Flash Drive

    Hi Phil,

    Thanks for this. The only issue I have is that the second image and the PDF download don't fall into the scope of the main body area, I need them to be in specifically designated areas of the template, so have made the assumption that this would need to be done via custom fields within the custom post type?

    Thanks
    David

  • Philip John
    • DEV MAN’s Apprentice

    Hiya,

    You'd need something separate. What you'd need to do is probably set a couple of custom fields and then create a custom plugin which hooks into 'the_content' and checks for those two fields, manipulating/acting upon them accordingly.

    If you're not sure about creating plugins yourself there are loads of tutorials on the web, or you could look for a developer on our job board.

    Phil

  • fortyfivecreative
    • Flash Drive

    Hi again Phil,
    So if I wanted to modify the custom post type functionality to hook in media uploads would I be better off creating the custom posts manually or could I still use the custompress plugin to create them? i.e. would custompress pick up any mods made to the core somehow?
    Thanks
    David

  • Philip John
    • DEV MAN’s Apprentice

    Hi David,

    You shouldn't need to edit core in anyway - just add a custom plugin that hooks into any custom fields you add, whether to posts or a custom post type.

    You should be able to do that easily whether it's a post type created by CustomPress or not - it shouldn't need to interact with CustomPress at all.

    Phil

  • fortyfivecreative
    • Flash Drive

    Thanks Phil, getting somewhere! Next step is to show a page before 'single.php', which you referred to above as a custom taxonomy page, with the following data on:

    CUSTOM POST TYPE 1 (TITLE)
    _____________________________

    TAXONOMY 1 - CATEGORY X (SUBTITLE)
    > Post Excerpt
    > Post Excerpt
    > Post Excerpt

    TAXONOMY 1 - CATEGORY Y (SUBTITLE)
    > Post Excerpt
    > Post Excerpt
    > Post Excerpt

    TAXONOMY 1 - CATEGORY Z (SUBTITLE)
    > Post Excerpt
    > Post Excerpt
    > Post Excerpt

    ...and then a seperate page for CUSTOM POST TYPE 2 as per the above format

    Not sure what do do here as I need to display posts separated by taxonomy category, on a separate page for each Custom Post Type, not all on one page, ie. page 1 for custom post type 1 listings and page 2 for custom post type 2 listings.

    Thanks again

  • Philip John
    • DEV MAN’s Apprentice

    Next step is to show a page before 'single.php'

    Not sure what you mean by that sorry, can you clarify? Single.php is the single post template - it's used to show a single post and will be used for any custom post type as well unless a separate template is specified. Pages use the page.php template file.

    Okay, looks like you're going to need to loop through your post types, then your taxonomies (see get_taxonomies) and then have several post loops within that for each category...

    Phil

  • Philip John
    • DEV MAN’s Apprentice

    Hi David,

    Apologies for the delay - I didn't get your e-mail before I left for a weeks break. I've just looked at the PDF you sent through and here are my thoughts...

    To create page 5 you will need to create a custom plugin which creates a new custom 'page' (using WP_Rewrite). On that 'page' you will need to loop through each of the taxonomies for your "Eye Care Professional (ECP) products" post type and for each taxonomy, create a post loop for that taxonomy only.

    You assume correctly that you'll need a custom single-posttype.php template file in your theme to customise the detail page for each post.

    Hope that helps,
    Phil

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.