WordPress.org

Ready to get started?Download WordPress

Forums

Image caption plugin help (11 posts)

  1. mikeboy3
    Member
    Posted 6 years ago #

    Greetings, I am using the "The Morning After" wp magazine theme, and it has a very nice feature, it allows for images to be added in a box with a caption text. however, there is no automatic way of doing this procedure, and I must add the code manually, code which is automatically changed by WordPress when I switch back to the visual editor.

    I would need a way to add a button to the visual editor that will allow me to select from 3 styles, "captionleft"/"captionright"/"captionfull", input an image url, followed by the caption text, and it would code it in the following way at the top of the post.

    <div class="captionleft"><img src="path/to/image.jpg" alt="alt text" /><p>Caption goes here</p></div>

    I would really appreciate any help you can give me.

  2. Jeremy Clark
    Moderator
    Posted 6 years ago #

    Disable the visual editor all together. In your Dashboard click the My profile link in the top right and then uncheck the box that says use visual editor.

  3. mikeboy3
    Member
    Posted 6 years ago #

    yes, but then I could not use the visual editor at all, and I like it :p

  4. moshu
    Member
    Posted 6 years ago #

    You can't have both. You either know what you are doing and use code or no code, just the wysiwyg monster.

  5. Jeremy Clark
    Moderator
    Posted 6 years ago #

  6. mikeboy3
    Member
    Posted 6 years ago #

    arrrgh, well, I guess the easiest solution would be to edit everything in the visual editor, and then just change to code view and add this code by hand...
    How come the wysiwyg editor changes everything? If there an alternative to it?

  7. Jeremy Clark
    Moderator
    Posted 6 years ago #

    There is quite a few different ones. Look here.
    http://wordpress.org/extend/plugins/tags/formatting

  8. moshu
    Member
    Posted 6 years ago #

    the easiest solution would be to edit everything in the visual editor, and then just change to code view and add this code by hand...

    False, unfortunately.
    Even if you switch between Visual and Code - it means the wysiwyg gizmo is turned ON, so it will always screw up your handmade code!

  9. mikeboy3
    Member
    Posted 6 years ago #

    thanks jeremyclark13, the plugin is really useful, I'll give it a try!

  10. Ivovic
    Member
    Posted 6 years ago #

    the visual editor suffers from other problems too, like removing empty alt attributes, for one.

    if you REALLY want to keep using the visual editor, then I suggest adding your image captions by JavaScript, there are plenty of DOM Captioning scripts you can google for.

    I'm doing something similar myself, by running a script on the page to extract the alt attribute from images and use them as captions.

    ... that way I don't have to add extra markup/divs/garbage to my posts which invariably show up in the wrong spot in RSS feeds.

  11. contentspring
    Member
    Posted 6 years ago #

    Try the Image Caption Easy plugin, it does what you're after: http://imagecaptioneasy.contentspring.com/.

Topic Closed

This topic has been closed to new replies.

About this Topic