- This topic is empty.
May 12, 2015 at 5:31 pm #202093noahgelmanParticipant
For example I make a post with the url:
Inside that post is a wordpress gallery with a couple images.
Can I get the images in that post to have their own custom url like so:
Those urls would link to the individual images of the post gallery. I would also like to have my own code template to display those images.
Is this possible? I know it’s a weird request.May 28, 2015 at 11:17 am #202964BarryParticipant
The easiest solution for this is for each image be its own post and have the permalink be %category%/%postname% where %category% will be whatever category you place that post under (uncategorized default).
CheersMay 28, 2015 at 3:38 pm #202965AlenParticipant
What exactly are you trying to achieve? You just might be fighting the tool, rewriting it. WordPress manages the media for you and has available functions to get the data you want, all you have to do is design a template.May 29, 2015 at 7:39 am #202979SenffParticipant
This reply has been reported for inappropriate content.
You can do this, but it would probably involve creating a whole plugin around it. You’d basically be creating shortened URLs that point to other URLs. For example:
http://www.mysite.com/sports/1 –> http://www.mysite.com/wp-content/uploads/2015/04/surfing.jpg
http://www.mysite.com/sports/2 –> http://www.mysite.com/wp-content/uploads/2015/05/footbal.jpg
http://www.mysite.com/cities/1 –> http://www.mysite.com/wp-content/uploads/2015/03/montreal.jpg
http://www.mysite.com/cities/2 –> http://www.mysite.com/wp-content/uploads/2015/05/new-york.jpg
http://www.mysite.com/cities/3 –> http://www.mysite.com/wp-content/uploads/2015/04/london.jpg
You’d have to keep track of these redirects/mappings, in case something changes, so there’d be database work involved. If it would be a plugin, then maybe it could also add a field in the media’s properties page, where this shortened URL could be entered.
So yea, it would be a bit of work…but it can be done.May 29, 2015 at 11:23 am #202987AlenParticipant
You can re-write this at server level, it would make more sense than creating a plugin. But again, I don’t think the question here is can it be done, many thing can be done, but why and should it be done. What happens when WordPress releases a breaking change, are you willing to maintain that plugin? Just doesn’t seem productive.
- You must be logged in to reply to this topic.