Tips and Tricks HQ Support Portal › Forums › WP Lightbox Ultimate › Lightbox Ultimate – User anchor text/ image with caption shortcode
Tagged: lightbox ultimate caption
- This topic has 5 replies, 2 voices, and was last updated 12 years, 10 months ago by
wpCommerce.
-
AuthorPosts
-
March 20, 2012 at 11:59 pm #5874
imeister
MemberBackground info: WP 3.3.1, and I just bought the plugin today so it’s up to date
I know how to place captioned photos. I know how to add a Title to a prettyPhoto that displays *after* the overlay comes up. What I’m *hoping* exists is the ability to use the title as the caption before the image is clicked. I’ve accomplished this with putting a prettyPhoto shortcode inside a caption shortcode, but it only works if you never open that page or post in the Visual editor. The moment you do, the visual editor strips the caption shortcode.
Any suggestions?
March 21, 2012 at 3:38 am #43218wpCommerce
ModeratorHi, could you show me how you are using lightbox ultimate shortcode inside the caption shortcode?
March 21, 2012 at 11:36 pm #43219imeister
MemberThis is long, so forgive me:
Normally, Caption would surround an image anchor. Instead, I insert both a caption and a prettyPhoto, remove the anchor from the capture shortcode and substitute the prettyPhoto shortcode. It works great — as long as you never open that post in the Visual editor. If you do, the caption portion is stripped and you can’t undo it. I did have to slightly modify the CSS to get the description not to overlap the photo, but other than that it’s perfect.
The basic format is [caption ...][wp_lightbox_prettyPhoto_image …][/caption]
[caption id="attachment_388" align="alignright" width="300" caption="University of Pennsylvania student (Clara Ng), conducted surveys to explore the causes of childhood diabetes and malnutrition in the village of Fouh, Mali."][wp_lightbox_prettyPhoto_image link=”http://50.116.82.164/~palms/wp-content/uploads/2009/12/Clara2.jpg” description=”University of Pennsylvania student (Clara Ng), conducted surveys to explore the causes of childhood diabetes and malnutrition in the village of Fouh, Mali.” source=”http://50.116.82.164/~palms/wp-content/uploads/2009/12/Clara2-300×225.jpg”%5D%5B/caption%5D
March 22, 2012 at 5:29 am #43220wpCommerce
ModeratorHi, I think you can also use it in the visual editor. For example:
[caption id="attachment_388" align="alignright" width="300" caption="Title goes here"]
[wp_lightbox_prettyPhoto_image link="http:www.example.com/overlay-image.jpg" description="description goes here" title="title goes here" source="http://www.example.com/anchor-image.jpg"]
[/caption]As long as you don’t switch between the two editors it should work (it worked for me).
March 22, 2012 at 10:48 am #43221imeister
MemberSorry, but that’s exactly the solution I just described and had already come up with. The problem is that I can’t *not* switch between editors. I’m comfortable with the HTML editor, but my client is not, and there are dozens of images with captions I was hoping to apply this to.
How hard would it be to create a single shortcode that did both?
March 22, 2012 at 11:40 pm #43222wpCommerce
ModeratorHi, you are supposed to use it with an image but you are using it with a shortcode which doesn’t get filtered until you load the page.
Generally, when you switch from visual to html editor the image is interpreted as
<a h href="www.example.com/your-image.jpg"....</a>
. It cannot do the same for shortcode. I guess that’s why the caption shortcode is not functioning. -
AuthorPosts
- You must be logged in to reply to this topic.