0

Here is what i have so far.

single-cpt.php

On this page I would like to create another custom meta box, which will be an additional 'editor'. I would like to be able to add a gallery to this editor.

That's fine and I've tested it and it works.

In addition to this I would like to; - Just display a link to the gallery and have the gallery open its own page. Which would be a child of this post/page? - Or the gallery could be hidden and the link, when clicked shows/displays the gallery using css.

I require the feature as I have many images and don't want to overload the visitor with them, but if they are interested i want show them!

Any suggestions would be greatly appreciated.

Thanks

  • have a look at add_rewrite_endpoint – Milo Jan 17 '14 at 17:39
  • That seems a little above my skill/knowledge level for now. Could you advise any further reading? – JohnLion Jan 17 '14 at 18:02
  • there are a few examples on this site you could adapt if you look around, like this. – Milo Jan 17 '14 at 18:15
  • If I go ahead and add a rewrite endpoint. That is single-gallery.php and call my custom meta box 'editor' to pull in the gallery. Will it display the gallery for the specific post? Does this page know that it is the child of the original post? – JohnLion Jan 17 '14 at 19:25
  • the main query will be identical to the page sans endpoint, so the loop will contain exactly the same data. you could alternately move the code that checks for the presence of the endpoint into the template if you'd like, and handle the whole thing with an if/else in that one file. – Milo Jan 17 '14 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.