Jump to content


Photo
- - - - -

Image caption doesn't work with Bootstrap


  • Please log in to reply
15 replies to this topic

#1 revoltoid

revoltoid

    Advanced Member

  • Members

  • 99 posts
  • Country: Country Flag

Posted 25 June 2012 - 04:21 PM

Hello,

I tried to use the new WP 3.4 image caption feature but experienced a little difficulty with Bootstrap codes.

I have a

Please Login or Register to see this Hidden Content

with an image inserted the Bootstrap way:


Title



documentary wedding photography edinburgh-test

Now if I try to add a caption, it doesn't get saved, no lines appear on the html tab in the editor, nothing is displayed. I edit the image, update, then update the page itself, but when I return to the image, the caption field is empty .


Also have

Please Login or Register to see this Hidden Content

that is plain editor-formatted and the caption works, it inserts this lines on the html tab:
[caption id="attachment_217" align="alignright" width="490"]documentary wedding photography canongate kirk caption test[/caption]

So, what am I missing? Thanks!

#2 beardedavenger

beardedavenger

    Unicorn Wrangler

  • Members

  • 1219 posts
  • Country: Country Flag

Posted 25 June 2012 - 05:29 PM

Hey THere, The caption is from Wordpress, not Bootstrap. In your first example, your're missing the wp-caption shortcode. So, wrap your in side a caption shortcode. Nick

#3 revoltoid

revoltoid

    Advanced Member

  • Members

  • 99 posts
  • Country: Country Flag

Posted 27 June 2012 - 01:04 AM

Hello Nick, thanks. I know that the caption is a wordpress thing. My problem is exactly the caption shortcode. Why is that when I create a caption for am image by editing it via the visual tab in the editor it inserts the code when I update/save the options, but it doesnt when the photo is inserted by bootstrap codes? Do I have to manually insert the caption shortcode every time I use bootstrap codes?

#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 27 June 2012 - 01:38 AM

Second example you don't close the img tag with before [/caption]

#5 revoltoid

revoltoid

    Advanced Member

  • Members

  • 99 posts
  • Country: Country Flag

Posted 28 June 2012 - 01:46 PM

Not sure what you mean rangelone. The second example does work. It is the first one that doesnt. My main problem is: when I try to add a caption for an image inserted into a post while editing a page on the visual tab in the editor, the caption is not saved when I update the image. The caption field is empty again after saving. Parallelly, it does not insert the codes for the caption on the html tab either. This only happens if the image was inserted into the post text by Bootstrap codes. It does work when the post was edited the normal way using the 'add media' button when embedding the image.

#6 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 28 June 2012 - 01:55 PM

You cant switch between visual and html editor, use one or the other.

#7 revoltoid

revoltoid

    Advanced Member

  • Members

  • 99 posts
  • Country: Country Flag

Posted 28 June 2012 - 05:12 PM

Thanks Simon, Well, that is new to me, I have been editing posts by switching html and visual tab and used whatever was suitable for certain tasks. Is it not how everyone uses the editor? Are you saying that if I intend to use any shortcodes (plugin shortcodes for example) I can only use the html tab on the editor and cant touch the visual tab to edit the post? As I can't insert a shortcode on the visual tab.

#8 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 28 June 2012 - 05:29 PM

Sorry, why did you reject my answer? Use the visual editor to create your post, add the image etc, then switch to html mode to add your custom stuff, then save.

#9 revoltoid

revoltoid

    Advanced Member

  • Members

  • 99 posts
  • Country: Country Flag

Posted 28 June 2012 - 05:45 PM

Sorry Simon, But I have never actually rejected any answers in the past until I have read that this is what I should do till I don't consider my problem solved, am I wrong? I wouldn't use this feature myself, I only used it to obey the forum rules, so you have quite surprised me with your question. I may have misunderstood something? "Clicking "reject" on an answer tells the moderators that the answer provided did not solve your problem and you still need help." Back to the subject, "Use the visual editor to create your post, add the image etc, then switch to html mode to add your custom stuff, then save." So how do I create my post if want to make a good use of the Bootstrap column grid? I can not start with the visual editor, can I? Can we concentrate on my original question please, which was whether I can add a caption via the visual editor if the image itself is inserted in Bootstrap codes on the HTML tab?

#10 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 28 June 2012 - 06:07 PM

Heres how i created the post with the html editor

Please Login or Register to see this Hidden Content



#11 revoltoid

revoltoid

    Advanced Member

  • Members

  • 99 posts
  • Country: Country Flag

Posted 29 June 2012 - 02:47 PM

Thank you Simon for that presentation, its great! Now, you inserted the image BEFORE adding the Bootstrap codes. My problem is adding it afterwards. Lets say, you plan the layout/grid of the page/post, you write your text, and publish the page without the photos. Then you decide/find which photo you would like to add, or maybe you would like to replace the existing one with a better one. You delete the image and insert the new one. Now, your caption will not be saved and will not work. Wordpress is not inserting the necessary caption codes into the Bootstrap codes.

#12 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 29 June 2012 - 04:16 PM

Is this what you are trying to do?

Please Login or Register to see this Hidden Content



#13 revoltoid

revoltoid

    Advanced Member

  • Members

  • 99 posts
  • Country: Country Flag

Posted 29 June 2012 - 07:21 PM

Thanks again for the video. Yes, that is it, with a slight difference. When I insert the image the very first time, I don't give it a caption (lets say I don't know the person's name who is on the photo), but I want to go ahead with publishing the post and collect details later. So the image is now inserted without any captions. Later I find out what exactly I want as a capture so I go to the editor, hit the visual tab, click on the photo, then hit the edit image button on the top left of it to start editing/updating. I enter something in the caption field and update/save it. Now the caption did not get saved, the field is empty again when I open the edit image window.

#14 Jenny

Jenny

    Advocate

  • Unicorn Store Dev

  • 2924 posts
  • LocationWV
  • Country: Country Flag

Posted 29 June 2012 - 08:09 PM

The entire caption process is Wordpress-related and not a feature or setting of PageLines at all. Have you posted over on the

Please Login or Register to see this Hidden Content

about this?

#15 revoltoid

revoltoid

    Advanced Member

  • Members

  • 99 posts
  • Country: Country Flag

Posted 30 June 2012 - 10:42 AM

The reason I haven't was that I noticed this happens only when bootstrap codes are involved, and bootstrap comes with my framework and not wordpress. It seems I should try the wp forums as well, thanks.

#16 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 30 June 2012 - 03:24 PM

Let us know what the people on WP forums say in case they might have any insight.