does anybody know how I can achieve the following:
- I have a custom post type called ‘projects’ I have 5 different page
layouts (each with a different number of images at different sizes
that are arranged differently). I think that if I can ID the images I
can position them using CSS. If each layout has it’s own template page
with containers for the required images and each also has CSS to
position the images. - I am wondering if it’s possible to add a
template select on right hand side of post editor view, like you have
available for pages this way it’s possible to assign a template (from
1-5) for each post. - I am adding custom meta boxes for the image upload fields
and the other data in the main post editor, but ideally this should
change for the other pages to only display the required upload
fields.
Any ideas anybody? I did consider setting up a custom post type for each layout (the 5 templates) allowing you to post a new project under the layout type you require, then on the page query the loop with all 5 custom-post-types (layouts). I worry this might be messy though, because to find projects to edit later you will need to know which template page (custom-post-type) they belong to but more importantly the url to projects wouldn’t be www.sitename.co.uk/projects but instead be www.sitename.co.uk/custom-post-type1, www.sitename.co.uk/custom-post-type2 ??? Wouldn’t it?
Any help really appreciated as always. Thanks
here is code I have identified so far, any ideas how to customise?
Should this go in functions.php?
Second code:
Third code:
You can create meta box using this code. Please paste this code in your function.php.